From d391e2d20491d99789a81edc515bfc8cef978478 Mon Sep 17 00:00:00 2001 From: xylosper Date: Thu, 13 Mar 2014 10:55:22 +0900 Subject: command: fix wrong condition & remove redundant stream type checking --- player/command.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index 74f32cc8b6..843042165a 100644 --- a/player/command.c +++ b/player/command.c @@ -182,19 +182,6 @@ static int mp_property_filename(m_option_t *prop, int action, void *arg, return r; } -static int media_title_from_stream(struct stream *stream, char **name) -{ - if (!stream) - return false; - switch (stream->type) { - case STREAMTYPE_DVD: - case STREAMTYPE_BLURAY: - return stream_control(stream, STREAM_CTRL_GET_DISC_NAME, name); - default: - return false; - } -} - static int mp_property_media_title(m_option_t *prop, int action, void *arg, MPContext *mpctx) { @@ -207,7 +194,8 @@ static int mp_property_media_title(m_option_t *prop, int action, void *arg, name = demux_info_get(mpctx->master_demuxer, "title"); if (name && name[0]) return m_property_strdup_ro(prop, action, arg, name); - if (media_title_from_stream(mpctx->master_demuxer->stream, &name) + struct stream *stream = mpctx->master_demuxer->stream; + if (stream_control(stream, STREAM_CTRL_GET_DISC_NAME, &name) > 0 && name) { int r = m_property_strdup_ro(prop, action, arg, name); talloc_free(name); -- cgit v1.2.3