diff options
author | wm4 <wm4@nowhere> | 2013-05-15 15:06:21 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-05-15 15:06:21 +0200 |
commit | 4930681e7a361e108d9554fa0d8dd2d40d3b4c2e (patch) | |
tree | 874df38bc9063460145ff329fc0b8378d9d1caf3 /core | |
parent | c2f96b020d6891f5c554608a63a75495419e660e (diff) | |
download | mpv-4930681e7a361e108d9554fa0d8dd2d40d3b4c2e.tar.bz2 mpv-4930681e7a361e108d9554fa0d8dd2d40d3b4c2e.tar.xz |
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.
Diffstat (limited to 'core')
-rw-r--r-- | core/command.c | 9 |
1 files 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, |