diff options
Diffstat (limited to 'player')
-rw-r--r-- | player/audio.c | 3 | ||||
-rw-r--r-- | player/core.h | 1 | ||||
-rw-r--r-- | player/misc.c | 18 | ||||
-rw-r--r-- | player/video.c | 6 |
4 files changed, 22 insertions, 6 deletions
diff --git a/player/audio.c b/player/audio.c index 3b3a06bd69..0fd6f99226 100644 --- a/player/audio.c +++ b/player/audio.c @@ -214,9 +214,8 @@ void reinit_audio_chain(struct MPContext *mpctx) init_error: uninit_player(mpctx, INITIALIZED_ACODEC | INITIALIZED_AO); no_audio: - mp_deselect_track(mpctx, track); if (track) - MP_INFO(mpctx, "Audio: no audio\n"); + error_on_track(mpctx, track); } // Return pts value corresponding to the end point of audio written to the diff --git a/player/core.h b/player/core.h index dfba2fd45f..1c67c85b2b 100644 --- a/player/core.h +++ b/player/core.h @@ -425,6 +425,7 @@ void merge_playlist_files(struct playlist *pl); float mp_get_cache_percent(struct MPContext *mpctx); bool mp_get_cache_idle(struct MPContext *mpctx); void update_window_title(struct MPContext *mpctx, bool force); +void error_on_track(struct MPContext *mpctx, struct track *track); void stream_dump(struct MPContext *mpctx); // osd.c diff --git a/player/misc.c b/player/misc.c index d5e27f9584..394a4ca0d1 100644 --- a/player/misc.c +++ b/player/misc.c @@ -175,6 +175,24 @@ void update_window_title(struct MPContext *mpctx, bool force) } } +void error_on_track(struct MPContext *mpctx, struct track *track) +{ + if (!track) + return; + mp_deselect_track(mpctx, track); + if (track) { + if (track->type == STREAM_AUDIO) + MP_INFO(mpctx, "Audio: no audio\n"); + if (track->type == STREAM_VIDEO) + MP_INFO(mpctx, "Video: no video\n"); + if (!mpctx->current_track[0][STREAM_AUDIO] && + !mpctx->current_track[0][STREAM_VIDEO]) + mpctx->stop_play = PT_NEXT_ENTRY; + mpctx->error_playing = true; + mpctx->sleeptime = 0; + } +} + void stream_dump(struct MPContext *mpctx) { struct MPOpts *opts = mpctx->opts; diff --git a/player/video.c b/player/video.c index 27655fc38a..679adb289c 100644 --- a/player/video.c +++ b/player/video.c @@ -310,7 +310,7 @@ err_out: no_video: uninit_player(mpctx, INITIALIZED_VCODEC | (opts->force_vo ? 0 : INITIALIZED_VO)); if (track) - mp_deselect_track(mpctx, track); + error_on_track(mpctx, track); handle_force_window(mpctx, true); return 0; } @@ -822,9 +822,7 @@ error: if (!opts->force_vo) uninit |= INITIALIZED_VO; uninit_player(mpctx, uninit); - 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; } |