mirror of
https://github.com/mpv-player/mpv
synced 2025-01-15 11:31:02 +00:00
command: fix wrong condition & remove redundant stream type checking
This commit is contained in:
parent
2f72eecd89
commit
d391e2d204
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user