diff options
author | xylosper <darklin20@gmail.com> | 2014-03-12 14:41:34 +0900 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-03-13 14:36:20 +0100 |
commit | 2f72eecd890da9c6f460b1351e02b90610dff88c (patch) | |
tree | a2d07b06b9700dced4fc707758b96c98c3c433c6 /player | |
parent | d80dc885c6e0dc1b2d5defa6aeed215a710c0340 (diff) | |
download | mpv-2f72eecd890da9c6f460b1351e02b90610dff88c.tar.bz2 mpv-2f72eecd890da9c6f460b1351e02b90610dff88c.tar.xz |
command: set 'media-title' property for bluray disc with meta-data
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c index c797a81800..74f32cc8b6 100644 --- a/player/command.c +++ b/player/command.c @@ -182,6 +182,19 @@ 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) { @@ -194,11 +207,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); - struct stream *stream = mpctx->master_demuxer->stream; - if (stream && stream->type == STREAMTYPE_DVD && - stream_control(stream, STREAM_CTRL_GET_DVD_VOLUME_ID, &name) && - name) - { + if (media_title_from_stream(mpctx->master_demuxer->stream, &name) + && name) { int r = m_property_strdup_ro(prop, action, arg, name); talloc_free(name); return r; |