diff options
author | Thomas Weißschuh <thomas@t-8ch.de> | 2023-07-30 10:20:09 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-07-30 19:48:35 +0200 |
commit | 1608059d64532e0461e3bec09b20a71802dcb2aa (patch) | |
tree | 4b12164032a417dc8715760b70fb9d6e73632884 | |
parent | 0fb7ab62c545032499042dceaacda6741718dd65 (diff) | |
download | mpv-1608059d64532e0461e3bec09b20a71802dcb2aa.tar.bz2 mpv-1608059d64532e0461e3bec09b20a71802dcb2aa.tar.xz |
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.
-rw-r--r-- | audio/out/ao.h | 7 | ||||
-rw-r--r-- | player/audio.c | 26 | ||||
-rw-r--r-- | player/command.c | 3 | ||||
-rw-r--r-- | player/core.h | 1 |
4 files changed, 0 insertions, 37 deletions
diff --git a/audio/out/ao.h b/audio/out/ao.h index 0ff4902021..baa8d35a02 100644 --- a/audio/out/ao.h +++ b/audio/out/ao.h @@ -34,8 +34,6 @@ enum aocontrol { AOCONTROL_SET_MUTE, // Has char* as argument, which contains the desired stream title. AOCONTROL_UPDATE_STREAM_TITLE, - // Has enum aocontrol_media_role* argument, which contains the current media role - AOCONTROL_UPDATE_MEDIA_ROLE, }; // If set, then the queued audio data is the last. Note that after a while, new @@ -60,11 +58,6 @@ enum { AO_INIT_EXCLUSIVE = 1 << 3, }; -enum aocontrol_media_role { - AOCONTROL_MEDIA_ROLE_MUSIC, - AOCONTROL_MEDIA_ROLE_MOVIE, -}; - struct ao_device_desc { const char *name; // symbolic name; will be set on ao->device const char *desc; // verbose human readable name 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); diff --git a/player/command.c b/player/command.c index 0eb13a7eed..9886201b53 100644 --- a/player/command.c +++ b/player/command.c @@ -6779,9 +6779,6 @@ static void command_event(struct MPContext *mpctx, int event, void *arg) if (event == MP_EVENT_WIN_STATE2) ctx->cached_window_scale = 0; - if (event == MPV_EVENT_FILE_LOADED) - audio_update_media_role(mpctx); - if (event == MP_EVENT_METADATA_UPDATE) { struct playlist_entry *const pe = mpctx->playing; if (!pe->title) { diff --git a/player/core.h b/player/core.h index 5ea7bd844c..df98b6c2e9 100644 --- a/player/core.h +++ b/player/core.h @@ -488,7 +488,6 @@ int init_audio_decoder(struct MPContext *mpctx, struct track *track); void reinit_audio_chain_src(struct MPContext *mpctx, struct track *track); void audio_update_volume(struct MPContext *mpctx); void audio_update_balance(struct MPContext *mpctx); -void audio_update_media_role(struct MPContext *mpctx); void reload_audio_output(struct MPContext *mpctx); void audio_start_ao(struct MPContext *mpctx); |