From c9d38107d2a676557e653fff6d37cbf9c91836ce Mon Sep 17 00:00:00 2001 From: Erik Zandvliet Date: Thu, 19 May 2016 13:09:31 +0200 Subject: [PATCH] Wait for keyframe in live input --- src/io.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/io.cpp b/src/io.cpp index c6e42a71..60862037 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -495,7 +495,7 @@ namespace Mist { } //Determine if we need to open the next page int nextPageNum = -1; - if (isKeyframe || !pagesByTrack.count(tid) || pagesByTrack[tid].size() == 0) { + if (isKeyframe) { //If there is no page, create it if (!pagesByTrack.count(tid) || pagesByTrack[tid].size() == 0) { nextPageNum = 1; @@ -523,6 +523,10 @@ namespace Mist { nextPageNum = 1; } } + //If we have no pages by track, we have not received a starting keyframe yet. Drop this packet. + if (!pagesByTrack.count(tid) || pagesByTrack[tid].size() == 0){ + return; + } //At this point we can stop parsing when the track is not accepted if (trackState[tid] != FILL_ACC) { return;