From 8ba484f47cbb179bbea793b4f4ebd0f6b8e412a6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 5 Jan 2019 14:23:42 +0100 Subject: [PATCH] demux_timeline: disable end-of-segment handling in DASH mode Normal EDL needs to clip packets coming from the underlying demuxer to the segment range (including complicated stuff due to frame reordering). This is unwanted In pseudo-DASH mode. A broken or subtly incorrect manifest would lead to "bad stuff" happening. The intention of the pseudo-DASH mode is to literally concatenate fragments. --- demux/demux_timeline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demux/demux_timeline.c b/demux/demux_timeline.c index 7364ce8399..6728bb31b0 100644 --- a/demux/demux_timeline.c +++ b/demux/demux_timeline.c @@ -304,7 +304,7 @@ static bool d_read_packet(struct demuxer *demuxer, struct demux_packet **out_pkt assert(seg && seg->d); struct demux_packet *pkt = demux_read_any_packet(seg->d); - if (!pkt || pkt->pts >= seg->end) + if (!pkt || (!src->dash && pkt->pts >= seg->end)) src->eos_packets += 1; update_slave_stats(demuxer, seg->d); @@ -370,7 +370,7 @@ static bool d_read_packet(struct demuxer *demuxer, struct demux_packet **out_pkt if (pkt->pos >= 0) pkt->pos |= (seg->index & 0x7FFFULL) << 48; - if (pkt->pts != MP_NOPTS_VALUE && pkt->pts >= seg->end) { + if (pkt->pts != MP_NOPTS_VALUE && !src->dash && pkt->pts >= seg->end) { // Trust the keyframe flag. Might not always be a good idea, but will // be sufficient at least with mkv. The problem is that this flag is // not well-defined in libavformat and is container-dependent.