From a0804329927904fdeb70d9712ff23baaab161bb4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 1 Feb 2016 22:28:47 +0100 Subject: player: refactor: reduce some dependencies on current_track Don't mind me. --- player/loadfile.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index 7d5a5f847d..57c3588b9f 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1158,13 +1158,6 @@ reopen_file: enable_demux_thread(mpctx); - if (mpctx->current_track[0][STREAM_VIDEO] && - mpctx->current_track[0][STREAM_VIDEO]->attached_picture) - { - MP_INFO(mpctx, - "Displaying attached picture. Use --no-audio-display to prevent this.\n"); - } - #if HAVE_ENCODING if (mpctx->encode_lavc_ctx && mpctx->current_track[0][STREAM_VIDEO]) encode_lavc_expect_stream(mpctx->encode_lavc_ctx, AVMEDIA_TYPE_VIDEO); @@ -1176,20 +1169,23 @@ reopen_file: } #endif - if (!mpctx->current_track[0][STREAM_VIDEO] && - !mpctx->current_track[0][STREAM_AUDIO]) - { - MP_FATAL(mpctx, "No video or audio streams selected.\n"); - mpctx->error_playing = MPV_ERROR_NOTHING_TO_PLAY; - goto terminate_playback; - } - update_playback_speed(mpctx); reinit_video_chain(mpctx); reinit_audio_chain(mpctx); reinit_sub_all(mpctx); + if (!mpctx->vo_chain && !mpctx->ao_chain) { + MP_FATAL(mpctx, "No video or audio streams selected.\n"); + mpctx->error_playing = MPV_ERROR_NOTHING_TO_PLAY; + goto terminate_playback; + } + + if (mpctx->vo_chain && mpctx->vo_chain->is_coverart) { + MP_INFO(mpctx, + "Displaying attached picture. Use --no-audio-display to prevent this.\n"); + } + MP_VERBOSE(mpctx, "Starting playback...\n"); mpctx->playback_initialized = true; -- cgit v1.2.3