summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-17 21:32:41 +0100
committerwm4 <wm4@nowhere>2016-03-17 21:32:41 +0100
commitfd57503890703b705fcd82f2ba09d2d0977eb1ad (patch)
tree5af9eff621af797ed3aec61b90d68aae5726ae9b /demux
parent0d19316de2c743388e8b2fae7e238f7d4db1ab1f (diff)
downloadmpv-fd57503890703b705fcd82f2ba09d2d0977eb1ad.tar.bz2
mpv-fd57503890703b705fcd82f2ba09d2d0977eb1ad.tar.xz
demux_timeline: skip decoder reinit when seeking to same segment
"Normal" seeks, which don't actually switch the segment, do not need to reinit the decoders.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_timeline.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/demux/demux_timeline.c b/demux/demux_timeline.c
index 92cf1e6fcf..3c9748036d 100644
--- a/demux/demux_timeline.c
+++ b/demux/demux_timeline.c
@@ -93,9 +93,7 @@ static void switch_segment(struct demuxer *demuxer, struct segment *new,
double start_pts, int flags)
{
struct priv *p = demuxer->priv;
-
- if (p->current == new)
- return;
+ bool new_segment = p->current != new;
if (!(flags & (SEEK_FORWARD | SEEK_BACKWARD)))
flags |= SEEK_BACKWARD;
@@ -109,7 +107,8 @@ static void switch_segment(struct demuxer *demuxer, struct segment *new,
for (int n = 0; n < p->num_streams; n++) {
struct virtual_stream *vs = &p->streams[n];
- vs->new_segment = true;
+ if (new_segment)
+ vs->new_segment = true;
vs->eos_packets = 0;
}
@@ -132,7 +131,6 @@ static void d_seek(struct demuxer *demuxer, double seek_pts, int flags)
}
}
- p->current = NULL; // force seek
switch_segment(demuxer, new, pts, flags);
}