summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-22 20:28:20 +0200
committerwm4 <wm4@nowhere>2015-05-22 20:28:20 +0200
commita7c831f36d17fae13ef441a8f56281557cccd401 (patch)
tree9c628e5f3c73435892619b2e7649ab2823dbe8f4 /player/command.c
parentf9507fe9271329aba8b9f237ef71befde9e8b9f0 (diff)
downloadmpv-a7c831f36d17fae13ef441a8f56281557cccd401.tar.bz2
mpv-a7c831f36d17fae13ef441a8f56281557cccd401.tar.xz
command: deprecate audio-samplerate
Also replace their implementation with the recently introduced properties. One significant difference is that audio-channels using OSD formatting does not print the channel layout. The user can just use the replacement property instead.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c45
1 files changed, 2 insertions, 43 deletions
diff --git a/player/command.c b/player/command.c
index c6dc5d3fa0..36cbf6cded 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1692,47 +1692,6 @@ static int mp_property_audio_out_params(void *ctx, struct m_property *prop,
return property_audiofmt(fmt, action, arg);
}
-/// Samplerate (RO)
-static int mp_property_samplerate(void *ctx, struct m_property *prop,
- int action, void *arg)
-{
- MPContext *mpctx = ctx;
- struct mp_audio fmt = {0};
- if (mpctx->d_audio)
- fmt = mpctx->d_audio->decode_format;
- if (!fmt.rate)
- return M_PROPERTY_UNAVAILABLE;
- if (action == M_PROPERTY_PRINT) {
- *(char **)arg = talloc_asprintf(NULL, "%d kHz", fmt.rate / 1000);
- return M_PROPERTY_OK;
- }
- return m_property_int_ro(action, arg, fmt.rate);
-}
-
-/// Number of channels (RO)
-static int mp_property_channels(void *ctx, struct m_property *prop,
- int action, void *arg)
-{
- MPContext *mpctx = ctx;
- struct mp_audio fmt = {0};
- if (mpctx->d_audio)
- fmt = mpctx->d_audio->decode_format;
- if (!fmt.channels.num)
- return M_PROPERTY_UNAVAILABLE;
- switch (action) {
- case M_PROPERTY_PRINT:
- *(char **) arg = talloc_strdup(NULL, mp_chmap_to_str(&fmt.channels));
- return M_PROPERTY_OK;
- case M_PROPERTY_GET:
- *(int *)arg = fmt.channels.num;
- return M_PROPERTY_OK;
- case M_PROPERTY_GET_TYPE:
- *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_INT};
- return M_PROPERTY_OK;
- }
- return M_PROPERTY_NOT_IMPLEMENTED;
-}
-
/// Balance (RW)
static int mp_property_balance(void *ctx, struct m_property *prop,
int action, void *arg)
@@ -3386,8 +3345,8 @@ static const struct m_property mp_properties[] = {
{"audio-codec", mp_property_audio_codec},
{"audio-params", mp_property_audio_params},
{"audio-out-params", mp_property_audio_out_params},
- {"audio-samplerate", mp_property_samplerate},
- {"audio-channels", mp_property_channels},
+ M_PROPERTY_DEPRECATED_ALIAS("audio-samplerate", "audio-params/samplerate"),
+ M_PROPERTY_DEPRECATED_ALIAS("audio-channels", "audio-params/channel-count"),
{"aid", mp_property_audio},
{"balance", mp_property_balance},
{"volume-restore-data", mp_property_volrestore},