From 328b95101971e407d9db031e1d6186ada0bd5a6e Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 10 Sep 2013 15:39:05 +0200 Subject: command: make title property unavailable if there's no support Instead of returning 0 if the stream doesn't have title info, make the property unavailable. --- mpvcore/command.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mpvcore/command.c b/mpvcore/command.c index d986ae1a64..a5f66aae2b 100644 --- a/mpvcore/command.c +++ b/mpvcore/command.c @@ -559,10 +559,10 @@ static int mp_property_titles(m_option_t *prop, int action, void *arg, MPContext *mpctx) { struct demuxer *demuxer = mpctx->master_demuxer; - if (!demuxer) + unsigned int num_titles; + if (!demuxer || stream_control(demuxer->stream, STREAM_CTRL_GET_NUM_TITLES, + &num_titles) < 1) return M_PROPERTY_UNAVAILABLE; - int num_titles = 0; - stream_control(demuxer->stream, STREAM_CTRL_GET_NUM_TITLES, &num_titles); return m_property_int_ro(prop, action, arg, num_titles); } -- cgit v1.2.3