summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorxylosper <darklin20@gmail.com>2014-03-13 10:55:22 +0900
committerwm4 <wm4@nowhere>2014-03-13 14:36:20 +0100
commitd391e2d20491d99789a81edc515bfc8cef978478 (patch)
tree0048f176ded51a789bbc02004e295d6144e300c4 /player
parent2f72eecd890da9c6f460b1351e02b90610dff88c (diff)
downloadmpv-d391e2d20491d99789a81edc515bfc8cef978478.tar.bz2
mpv-d391e2d20491d99789a81edc515bfc8cef978478.tar.xz
command: fix wrong condition & remove redundant stream type checking
Diffstat (limited to 'player')
-rw-r--r--player/command.c16
1 files changed, 2 insertions, 14 deletions
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);