summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
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);