mplayer: rearrange misleading code

The print_timeline() function actually had contained some code that
changed the MPContext state. Since you wouldn't expect that from a
function named print, move that code out of the function. The
misleading code structure was introduced in commit 6f564fe82b.
This commit is contained in:
wm4 2012-08-04 02:01:21 +02:00
parent a4f7a3df50
commit c7fe5f58e3
1 changed files with 4 additions and 3 deletions

View File

@ -3462,9 +3462,6 @@ static void open_subtitles_from_options(struct MPContext *mpctx)
static void print_timeline(struct MPContext *mpctx)
{
if (mpctx->timeline) {
mpctx->timeline_part = 0;
mpctx->demuxer = mpctx->timeline[0].source->demuxer;
int part_count = mpctx->num_timeline_parts;
mp_msg(MSGT_CPLAYER, MSGL_V, "Timeline contains %d parts from %d "
"sources. Total length %.3f seconds.\n", part_count,
@ -3748,6 +3745,10 @@ goto_enable_cache:
if (mpctx->demuxer->type == DEMUXER_TYPE_CUE)
build_cue_timeline(mpctx);
if (mpctx->timeline) {
mpctx->timeline_part = 0;
mpctx->demuxer = mpctx->timeline[0].source->demuxer;
}
print_timeline(mpctx);
if (!mpctx->sources) {