summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-04 02:01:21 +0200
committerwm4 <wm4@nowhere>2012-08-04 19:59:55 +0200
commitc7fe5f58e3769d6f577cb42f60ec0d2386c8afc0 (patch)
tree02a6f822122c48a9cca2f8cef4921bb771fb1a0c
parenta4f7a3df50c82a427bde283aeb6a71f0faaec859 (diff)
downloadmpv-c7fe5f58e3769d6f577cb42f60ec0d2386c8afc0.tar.bz2
mpv-c7fe5f58e3769d6f577cb42f60ec0d2386c8afc0.tar.xz
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.
-rw-r--r--mplayer.c7
1 files changed, 4 insertions, 3 deletions
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) {