From c7fe5f58e3769d6f577cb42f60ec0d2386c8afc0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 4 Aug 2012 02:01:21 +0200 Subject: 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. --- mplayer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mplayer.c') diff --git a/mplayer.c b/mplayer.c index 0bb7f2a4b9..10c9c915d1 100644 --- a/mplayer.c +++ b/mplayer.c @@ -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) { -- cgit v1.2.3