From e20761e8c7784191b0cfb0fc004e07c27992e134 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 12 Nov 2015 11:11:32 +0100 Subject: [PATCH] Fix the case when a keyframe is not the first data pushed. --- src/io.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io.cpp b/src/io.cpp index 448556ac..f2851bd1 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -60,7 +60,7 @@ namespace Mist { //If this is not a valid page number on this track, stop buffering this page. if (!pagesByTrack[tid].count(pageNumber)){ - INFO_MSG("Aborting page buffer start: %lu is not a valid page number on track %lu~>%lu.", pageNumber, tid, mapTid); + WARN_MSG("Aborting page buffer start: %lu is not a valid page number on track %lu~>%lu.", pageNumber, tid, mapTid); std::stringstream test; for (std::map::iterator it = pagesByTrack[tid].begin(); it != pagesByTrack[tid].end(); it++){ test << it->first << " "; @@ -398,7 +398,7 @@ namespace Mist { } //Determine if we need to open the next page int nextPageNum = -1; - if (isKeyframe) { + if (isKeyframe || !pagesByTrack.count(tid) || pagesByTrack[tid].size() == 0) { //If there is no page, create it if (!pagesByTrack.count(tid) || pagesByTrack[tid].size() == 0) { nextPageNum = 1;