When no video channel is present, inject a seek time at most every ~2000ms.

This commit is contained in:
Thulinma 2013-03-25 19:49:00 +01:00
parent e1f7d2acea
commit ea9abcceb6

View file

@ -258,11 +258,13 @@ void DTSC::Stream::advanceRings(){
}while (repeat); }while (repeat);
} }
static int fragNum = 1; static int fragNum = 1;
if ((lastType() == VIDEO && buffers.front().isMember("keyframe")) || (!metadata.isMember("video") && lastType() == AUDIO)){ static unsigned int lastkeytime = 4242;
if ((lastType() == VIDEO && buffers.front().isMember("keyframe")) || (!metadata.isMember("video") && buffers.front()["time"].asInt() / 2000 != lastkeytime)){
keyframes.push_front(DTSC::Ring(0)); keyframes.push_front(DTSC::Ring(0));
if ( !buffers.front().isMember("fragnum")){ if ( !buffers.front().isMember("fragnum")){
buffers.front()["fragnum"] = fragNum++; buffers.front()["fragnum"] = fragNum++;
} }
lastkeytime = buffers.front()["time"].asInt() / 2000;
} }
unsigned int timeBuffered = 0; unsigned int timeBuffered = 0;
if (keyframes.size() > 1){ if (keyframes.size() > 1){