summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-18 16:48:47 +0100
committerwm4 <wm4@nowhere>2017-01-18 16:48:47 +0100
commit04858c0b83fd6c1fc60519c2034e263d2e7c3977 (patch)
treeada6b6e0f99bd997d180770f5abcb182f2603a5f /player
parente7d902bdc0bac2f8d5db1ce8b5fdd4757e31fd08 (diff)
downloadmpv-04858c0b83fd6c1fc60519c2034e263d2e7c3977.tar.bz2
mpv-04858c0b83fd6c1fc60519c2034e263d2e7c3977.tar.xz
player: move some minor demuxer setup code
In particular, move demux_set_ts_offset() out of the loader thread. There's no discernible reason for that, probably.
Diffstat (limited to 'player')
-rw-r--r--player/loadfile.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index b6027de0ca..872db20399 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -802,8 +802,6 @@ static void open_demux_thread(void *pctx)
args->err = MPV_ERROR_LOADING_FAILED;
}
}
- if (args->demux && global->opts->rebase_start_time)
- demux_set_ts_offset(args->demux, -args->demux->start_time);
}
static void open_demux_reentrant(struct MPContext *mpctx)
@@ -820,7 +818,6 @@ static void open_demux_reentrant(struct MPContext *mpctx)
mpctx_run_reentrant(mpctx, open_demux_thread, &args);
if (args.demux) {
mpctx->demuxer = args.demux;
- enable_demux_thread(mpctx, mpctx->demuxer);
} else {
mpctx->error_playing = args.err;
}
@@ -1038,6 +1035,10 @@ reopen_file:
goto terminate_playback;
}
+ if (mpctx->opts->rebase_start_time)
+ demux_set_ts_offset(mpctx->demuxer, -mpctx->demuxer->start_time);
+ enable_demux_thread(mpctx, mpctx->demuxer);
+
load_chapters(mpctx);
add_demuxer_tracks(mpctx, mpctx->demuxer);