|author||wm4 <wm4@nowhere>||2018-01-09 21:37:14 +0100|
|committer||Kevin Mitchell <email@example.com>||2018-01-10 22:32:37 -0800|
demux: add missing seekpoint when cached ranges are joined
The impact was that you couldn't exactly seek to the join point with a keyframe seek, even though there was a keyframe. This commit fixes it by preserving the necessary metadata that got lost on cached range joining. This is so absurdly obscure that it gets a longer code comment.
1 files changed, 8 insertions, 0 deletions
diff --git a/demux/demux.c b/demux/demux.c
index b903100b96..d904d03fbf 100644
@@ -999,6 +999,14 @@ static void attempt_range_joining(struct demux_internal *in)
+ // q1 usually meets q2 at a keyframe. q1 will end on a key-
+ // frame (because it tries joining when reading a keyframe).
+ // Obviously, q1 can not know the kf_seek_pts yet; it would
+ // have to read packets after it to compute it. Ideally,
+ // we'd remove it and use q2's packet, but the linked list
+ // makes this hard, so copy this missing metadata instead.
+ end->kf_seek_pts = dp->kf_seek_pts;
join_point_found = true;