Commit eb33ba04 authored by Martin Storsjö's avatar Martin Storsjö

hls: Return all packets from a previous variant before moving on to the next one

This serves as a safeguard; normally we want to use the dts
comparison to interleave packets from all active variants. If that
dts comparison for some reason doesn't work as intended, make sure
that all packets in all variants for a certain sequence number have
been returned before moving on to the next one.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent c5b46a06
...@@ -638,10 +638,13 @@ start: ...@@ -638,10 +638,13 @@ start:
} }
} }
} }
/* Check if this stream has the packet with the lowest dts */ /* Check if this stream still is on an earlier segment number, or
* has the packet with the lowest dts */
if (var->pkt.data) { if (var->pkt.data) {
if (minvariant < 0 || if (minvariant < 0 ||
var->pkt.dts < c->variants[minvariant]->pkt.dts) var->cur_seq_no < c->variants[minvariant]->cur_seq_no ||
(var->cur_seq_no == c->variants[minvariant]->cur_seq_no &&
var->pkt.dts < c->variants[minvariant]->pkt.dts))
minvariant = i; minvariant = i;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment