summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-02-01 22:28:47 +0100
committerwm4 <wm4@nowhere>2016-02-01 22:28:47 +0100
commita0804329927904fdeb70d9712ff23baaab161bb4 (patch)
tree591fb123c622d76c2836cd6b5e3b46ea6ad4c483 /player/loadfile.c
parent5c8378b71aaa4fbfda69ed9f50fe10f40cd124f2 (diff)
downloadmpv-a0804329927904fdeb70d9712ff23baaab161bb4.tar.bz2
mpv-a0804329927904fdeb70d9712ff23baaab161bb4.tar.xz
player: refactor: reduce some dependencies on current_track
Don't mind me.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c26
1 files changed, 11 insertions, 15 deletions
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;