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
1 changed files with 4 additions and 3 deletions

View File

@ -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);