summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c66
1 files changed, 10 insertions, 56 deletions
diff --git a/player/command.c b/player/command.c
index 7c1a6f3a6e..74c7e26966 100644
--- a/player/command.c
+++ b/player/command.c
@@ -277,26 +277,6 @@ int mp_on_set_option(void *ctx, struct m_config_option *co, void *data, int flag
{
struct MPContext *mpctx = ctx;
- // These options are too inconsistent as they could be pulled through the
- // property layer. Ideally we'd remove these inconsistencies in the future,
- // though the actual problem is compatibility to user-expected behavior.
- // What matters is whether _write_ access is different - property read
- // access is not used here.
- // We're also fine with cases where the property restricts the writable
- // value range if playback is active, but not otherwise.
- // OK, restrict during playback: vid, aid, sid, deinterlace, video-aspect,
- // vf*, af*, chapter
- // OK, is handled separately: playlist
- // OK, does not conflict on low level: audio-file, sub-file, external-file
- // OK, different value ranges, but happens to work for now: volume, edition
- // Incompatible: tv-freq
- // All the other properties are deprecated in their current form.
- static const char *const no_property[] = {
- "demuxer", "idle", "length", "audio-samplerate", "audio-channels",
- "audio-format", "fps", "cache", "playlist-pos", "chapter", "tv-freq",
- NULL
- };
-
// Normalize "vf*" to "vf"
const char *name = co->name;
bstr bname = bstr0(name);
@@ -306,11 +286,6 @@ int mp_on_set_option(void *ctx, struct m_config_option *co, void *data, int flag
name = tmp;
}
- for (int n = 0; no_property[n]; n++) {
- if (strcmp(co->name, no_property[n]) == 0)
- goto direct_option;
- }
-
struct m_option type = {0};
int r = mp_property_do_silent(name, M_PROPERTY_GET_TYPE, &type, mpctx);
@@ -3594,11 +3569,7 @@ static int mp_property_configuration(void *ctx, struct m_property *prop,
static int mp_property_ffmpeg(void *ctx, struct m_property *prop,
int action, void *arg)
{
-#if HAVE_AV_VERSION_INFO
return m_property_strdup_ro(action, arg, av_version_info());
-#else
- return M_PROPERTY_UNAVAILABLE;
-#endif
}
static int mp_property_alias(void *ctx, struct m_property *prop,
@@ -3614,20 +3585,16 @@ static int mp_property_deprecated_alias(void *ctx, struct m_property *prop,
MPContext *mpctx = ctx;
struct command_ctx *cmd = mpctx->command_ctx;
const char *real_property = prop->priv;
- if (action == M_PROPERTY_SET || action == M_PROPERTY_GET ||
- action == M_PROPERTY_PRINT)
- {
- for (int n = 0; n < cmd->num_warned_deprecated; n++) {
- if (strcmp(cmd->warned_deprecated[n], prop->name) == 0)
- goto done;
- }
- MP_WARN(mpctx, "Warning: property '%s' was replaced with '%s' and "
- "might be removed in the future.\n", prop->name, real_property);
- MP_TARRAY_APPEND(cmd, cmd->warned_deprecated, cmd->num_warned_deprecated,
- (char *)prop->name);
-
- done:;
+ for (int n = 0; n < cmd->num_warned_deprecated; n++) {
+ if (strcmp(cmd->warned_deprecated[n], prop->name) == 0)
+ goto done;
}
+ MP_WARN(mpctx, "Warning: property '%s' was replaced with '%s' and "
+ "might be removed in the future.\n", prop->name, real_property);
+ MP_TARRAY_APPEND(cmd, cmd->warned_deprecated, cmd->num_warned_deprecated,
+ (char *)prop->name);
+
+done:
return mp_property_do(real_property, action, arg, ctx);
}
@@ -3824,13 +3791,10 @@ static const struct m_property mp_properties_base[] = {
{"stream-path", mp_property_stream_path},
{"stream-capture", mp_property_stream_capture},
{"current-demuxer", mp_property_demuxer},
- // conflicts with option
- M_PROPERTY_DEPRECATED_ALIAS("demuxer", "current-demuxer"),
{"file-format", mp_property_file_format},
{"stream-pos", mp_property_stream_pos},
{"stream-end", mp_property_stream_end},
{"duration", mp_property_duration},
- M_PROPERTY_DEPRECATED_ALIAS("length", "duration"), // conflicts with option
{"avsync", mp_property_avsync},
{"total-avsync-change", mp_property_total_avsync_change},
{"drop-frame-count", mp_property_drop_frame_cnt},
@@ -3863,7 +3827,6 @@ static const struct m_property mp_properties_base[] = {
{"seeking", mp_property_seeking},
{"playback-abort", mp_property_playback_abort},
{"cache-percent", mp_property_cache},
- M_PROPERTY_DEPRECATED_ALIAS("cache", "cache-percent"), // conflicts with option
{"cache-free", mp_property_cache_free},
{"cache-used", mp_property_cache_used},
{"cache-size", mp_property_cache_size},
@@ -3878,7 +3841,6 @@ static const struct m_property mp_properties_base[] = {
{"seekable", mp_property_seekable},
{"partially-seekable", mp_property_partially_seekable},
{"idle-active", mp_property_idle},
- M_PROPERTY_DEPRECATED_ALIAS("idle", "idle-active"), // conflicts with option
{"chapter-list", mp_property_list_chapters},
{"track-list", property_list_tracks},
@@ -3901,9 +3863,6 @@ static const struct m_property mp_properties_base[] = {
{"audio-codec", mp_property_audio_codec},
{"audio-params", mp_property_audio_params},
{"audio-out-params", mp_property_audio_out_params},
- // conflicts with option
- 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},
{"audio-device", mp_property_audio_device},
@@ -3940,7 +3899,6 @@ static const struct m_property mp_properties_base[] = {
{"vo-performance", mp_property_vo_performance},
{"current-vo", mp_property_vo},
{"container-fps", mp_property_fps},
- M_PROPERTY_DEPRECATED_ALIAS("fps", "container-fps"), // conflicts with option
{"estimated-vf-fps", mp_property_vf_fps},
{"video-aspect", mp_property_aspect},
{"vid", mp_property_video},
@@ -4036,9 +3994,6 @@ static const struct m_property mp_properties_base[] = {
M_PROPERTY_ALIAS("colormatrix-input-range", "video-params/colorlevels"),
M_PROPERTY_ALIAS("colormatrix-primaries", "video-params/primaries"),
M_PROPERTY_ALIAS("colormatrix-gamma", "video-params/gamma"),
-
- // conflicts with option
- M_PROPERTY_DEPRECATED_ALIAS("audio-format", "audio-codec-name"),
};
// Each entry describes which properties an event (possibly) changes.
@@ -5593,8 +5548,7 @@ void command_init(struct MPContext *mpctx)
for (int n = 0; n < num_opts; n++) {
struct m_config_option *co = m_config_get_co_index(mpctx->mconfig, n);
assert(co->name[0]);
- if ((co->opt->flags & M_OPT_NOPROP) ||
- (co->opt->type->flags & M_OPT_TYPE_HAS_CHILD))
+ if (co->opt->flags & M_OPT_NOPROP)
continue;
struct m_property prop = {0};