1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-22 23:27:13 +00:00

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.
This commit is contained in:
wm4 2017-01-18 16:48:47 +01:00
parent e7d902bdc0
commit 04858c0b83

View File

@ -802,8 +802,6 @@ static void open_demux_thread(void *pctx)
args->err = MPV_ERROR_LOADING_FAILED; 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) 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); mpctx_run_reentrant(mpctx, open_demux_thread, &args);
if (args.demux) { if (args.demux) {
mpctx->demuxer = args.demux; mpctx->demuxer = args.demux;
enable_demux_thread(mpctx, mpctx->demuxer);
} else { } else {
mpctx->error_playing = args.err; mpctx->error_playing = args.err;
} }
@ -1038,6 +1035,10 @@ reopen_file:
goto terminate_playback; 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); load_chapters(mpctx);
add_demuxer_tracks(mpctx, mpctx->demuxer); add_demuxer_tracks(mpctx, mpctx->demuxer);