diff options
author | wm4 <wm4@nowhere> | 2015-01-16 20:15:30 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-16 20:22:43 +0100 |
commit | 280f123f35037e3d9615c1272e96d47d6c164655 (patch) | |
tree | 51d70f3bef11b4427c44307734ceb569e0f07604 /player/loadfile.c | |
parent | 730db25b1b17626c9d8f83fbe8e8e2596f0d0c2d (diff) | |
download | mpv-280f123f35037e3d9615c1272e96d47d6c164655.tar.bz2 mpv-280f123f35037e3d9615c1272e96d47d6c164655.tar.xz |
player: don't enable demuxer readahead before selecting tracks
This is for the ordered chapters case only. In theory this could have
resulted in initial audio, video or subs missing, although it didn't
happen in practice (because no streams were selected, thus the demuxer
thread didn't actually try to read anything). It's still better to make
this explicit.
Also, timeline_set_part() can be private to loadfile.c.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r-- | player/loadfile.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/player/loadfile.c b/player/loadfile.c index e3e1b4fa30..08077262de 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -270,13 +270,13 @@ static void enable_demux_thread(struct MPContext *mpctx) } } -bool timeline_set_part(struct MPContext *mpctx, int i, bool force) +static bool timeline_set_part(struct MPContext *mpctx, int i, bool initial) { struct timeline_part *p = mpctx->timeline + mpctx->timeline_part; struct timeline_part *n = mpctx->timeline + i; mpctx->timeline_part = i; mpctx->video_offset = n->start - n->source_start; - if (n->source == p->source && !force) + if (n->source == p->source && !initial) return false; uninit_audio_chain(mpctx); @@ -313,9 +313,11 @@ bool timeline_set_part(struct MPContext *mpctx, int i, bool force) } } } - reselect_demux_streams(mpctx); - enable_demux_thread(mpctx); + if (!initial) { + reselect_demux_streams(mpctx); + enable_demux_thread(mpctx); + } return true; } |