diff options
author | wm4 <wm4@nowhere> | 2014-10-23 18:31:43 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-23 18:31:43 +0200 |
commit | c9234d769df83b7280f68f9dc24445029f84041a (patch) | |
tree | 450904d51303eedfec45acdd448fcbd689a54aad /player/video.c | |
parent | 809fbc6fc1e862ab2dfcfcceeb65d7382d8b51e9 (diff) | |
download | mpv-c9234d769df83b7280f68f9dc24445029f84041a.tar.bz2 mpv-c9234d769df83b7280f68f9dc24445029f84041a.tar.xz |
player: fix exiting if both audio and video fail initializing
The player was supposed to exit playback if both video and audio failed
to initialize (or if one of the streams was not selected when the other
stream failed). This didn't work; for one this check was missing from
one of the failure paths. And more importantly, both checked the
current_track array incorrectly.
Fix these issues, and move the failure handling code into a common
function.
CC: @mpv-player/stable
Diffstat (limited to 'player/video.c')
-rw-r--r-- | player/video.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/player/video.c b/player/video.c index 77b6fb9a6d..62d0f486b7 100644 --- a/player/video.c +++ b/player/video.c @@ -327,7 +327,7 @@ err_out: no_video: uninit_video_chain(mpctx); if (track) - mp_deselect_track(mpctx, track); + error_on_track(mpctx, track); handle_force_window(mpctx, true); return 0; } @@ -836,9 +836,7 @@ void write_video(struct MPContext *mpctx, double endpts) error: MP_FATAL(mpctx, "Could not initialize video chain.\n"); uninit_video_chain(mpctx); - if (!mpctx->current_track[STREAM_AUDIO]) - mpctx->stop_play = PT_NEXT_ENTRY; - mpctx->error_playing = true; + error_on_track(mpctx, mpctx->current_track[STREAM_VIDEO][0]); handle_force_window(mpctx, true); mpctx->sleeptime = 0; } |