From 4930681e7a361e108d9554fa0d8dd2d40d3b4c2e Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 15 May 2013 15:06:21 +0200 Subject: command: use "title" tag for media-title property if available In connection with the previous commit, this will use the Matroska title for the media-title property. --- core/command.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/command.c b/core/command.c index 605520aab8..31739f768a 100644 --- a/core/command.c +++ b/core/command.c @@ -181,11 +181,14 @@ static int mp_property_media_title(m_option_t *prop, int action, void *arg, char *name = NULL; if (mpctx->resolve_result) name = mpctx->resolve_result->title; - if (name && name[0]) { + if (name && name[0]) return m_property_strdup_ro(prop, action, arg, name); - } else { - return mp_property_filename(prop, action, arg, mpctx); + if (mpctx->master_demuxer) { + name = demux_info_get(mpctx->master_demuxer, "title"); + if (name && name[0]) + return m_property_strdup_ro(prop, action, arg, name); } + return mp_property_filename(prop, action, arg, mpctx); } static int mp_property_stream_path(m_option_t *prop, int action, void *arg, -- cgit v1.2.3