summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-27 14:06:47 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-27 14:06:47 +0000
commit97ed05be95e1ba30b21d61bcd5d5ae533d280b6c (patch)
treea2c367af73dfff1380c6a9fcb70184363fd250be
parentea54d1771f9c15daf4afa25da15b92d77ae9dfba (diff)
downloadmpv-97ed05be95e1ba30b21d61bcd5d5ae533d280b6c.tar.bz2
mpv-97ed05be95e1ba30b21d61bcd5d5ae533d280b6c.tar.xz
Use the same condition to decide if the audio/video id property is
not available for all commands (get, set and print). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30121 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--command.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/command.c b/command.c
index 6539fe9017..73ab2d4be8 100644
--- a/command.c
+++ b/command.c
@@ -796,18 +796,16 @@ static int mp_property_audio(m_option_t * prop, int action, void *arg,
MPContext * mpctx)
{
int current_id = -1, tmp;
+ if (!mpctx->demuxer || !mpctx->demuxer->audio)
+ return M_PROPERTY_UNAVAILABLE;
switch (action) {
case M_PROPERTY_GET:
- if (!mpctx->sh_audio)
- return M_PROPERTY_UNAVAILABLE;
if (!arg)
return M_PROPERTY_ERROR;
*(int *) arg = audio_id;
return M_PROPERTY_OK;
case M_PROPERTY_PRINT:
- if (!mpctx->sh_audio)
- return M_PROPERTY_UNAVAILABLE;
if (!arg)
return M_PROPERTY_ERROR;
@@ -840,8 +838,6 @@ static int mp_property_audio(m_option_t * prop, int action, void *arg,
case M_PROPERTY_STEP_UP:
case M_PROPERTY_SET:
- if (!mpctx->demuxer || !mpctx->demuxer->audio)
- return M_PROPERTY_UNAVAILABLE;
if (action == M_PROPERTY_SET && arg)
tmp = *((int *) arg);
else
@@ -874,18 +870,16 @@ static int mp_property_video(m_option_t * prop, int action, void *arg,
MPContext * mpctx)
{
int current_id = -1, tmp;
+ if (!mpctx->demuxer || !mpctx->demuxer->video)
+ return M_PROPERTY_UNAVAILABLE;
switch (action) {
case M_PROPERTY_GET:
- if (!mpctx->sh_video)
- return M_PROPERTY_UNAVAILABLE;
if (!arg)
return M_PROPERTY_ERROR;
*(int *) arg = video_id;
return M_PROPERTY_OK;
case M_PROPERTY_PRINT:
- if (!mpctx->sh_video)
- return M_PROPERTY_UNAVAILABLE;
if (!arg)
return M_PROPERTY_ERROR;
@@ -900,8 +894,6 @@ static int mp_property_video(m_option_t * prop, int action, void *arg,
case M_PROPERTY_STEP_UP:
case M_PROPERTY_SET:
- if (!mpctx->demuxer || !mpctx->demuxer->video)
- return M_PROPERTY_UNAVAILABLE;
if (action == M_PROPERTY_SET && arg)
tmp = *((int *) arg);
else