summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorxylosper <darklin20@gmail.com>2014-02-24 00:43:04 +0900
committerwm4 <wm4@nowhere>2014-02-23 18:16:24 +0100
commit5cbef87c17ce4944893b53796370a1ffeb7a24f0 (patch)
tree38239784f3dbb5925ed604b1f7f1718960b7846c /player
parent8906e409250da939e40c57783ef349cfdecc99d8 (diff)
downloadmpv-5cbef87c17ce4944893b53796370a1ffeb7a24f0.tar.bz2
mpv-5cbef87c17ce4944893b53796370a1ffeb7a24f0.tar.xz
command: use DVD volume ID for media-title property
Signed-off-by: wm4 <wm4@nowhere> Closes #582.
Diffstat (limited to 'player')
-rw-r--r--player/command.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index 5f39817d46..4d4f552ffa 100644
--- a/player/command.c
+++ b/player/command.c
@@ -194,6 +194,15 @@ 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);
+ struct stream *stream = mpctx->master_demuxer->stream;
+ if (stream && stream->type == STREAMTYPE_DVD &&
+ stream_control(stream, STREAM_CTRL_GET_DVD_VOLUME_ID, &name) &&
+ name)
+ {
+ int r = m_property_strdup_ro(prop, action, arg, name);
+ talloc_free(name);
+ return r;
+ }
}
return mp_property_filename(prop, action, arg, mpctx);
}