From 1608059d64532e0461e3bec09b20a71802dcb2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 30 Jul 2023 10:20:09 +0200 Subject: Revert "audio: add AOCONTROL_UPDATE_MEDIA_ROLE" The only user of these APIs was ao_pipewire and the logic there got converted so drop the now dead code. This reverts commit 3167a77aa38b3700c9a4459fa5fe2f65eef080a8. --- player/audio.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'player/audio.c') diff --git a/player/audio.c b/player/audio.c index 2626bb24da..48aa90b1d2 100644 --- a/player/audio.c +++ b/player/audio.c @@ -190,30 +190,6 @@ void update_playback_speed(struct MPContext *mpctx) update_speed_filters(mpctx); } -static bool has_video_track(struct MPContext *mpctx) -{ - if (mpctx->vo_chain && mpctx->vo_chain->is_coverart) - return false; - - for (int n = 0; n < mpctx->num_tracks; n++) { - struct track *track = mpctx->tracks[n]; - if (track->type == STREAM_VIDEO && !track->attached_picture && !track->image) - return true; - } - - return false; -} - -void audio_update_media_role(struct MPContext *mpctx) -{ - if (!mpctx->ao) - return; - - enum aocontrol_media_role role = has_video_track(mpctx) ? - AOCONTROL_MEDIA_ROLE_MOVIE : AOCONTROL_MEDIA_ROLE_MUSIC; - ao_control(mpctx->ao, AOCONTROL_UPDATE_MEDIA_ROLE, &role); -} - static void ao_chain_reset_state(struct ao_chain *ao_c) { ao_c->last_out_pts = MP_NOPTS_VALUE; @@ -499,8 +475,6 @@ static int reinit_audio_filters_and_output(struct MPContext *mpctx) audio_update_volume(mpctx); - audio_update_media_role(mpctx); - // Almost nonsensical hack to deal with certain format change scenarios. if (mpctx->audio_status == STATUS_PLAYING) ao_start(mpctx->ao); -- cgit v1.2.3