From 56fefde7e2ee0c31e9d4d39b5bd0ca8a5643ebe5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 23 Oct 2015 14:58:01 +0200 Subject: command: make bitrate properties work correctly for external tracks --- player/command.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/player/command.c b/player/command.c index 79e522c1d9..b912a2ad1f 100644 --- a/player/command.c +++ b/player/command.c @@ -3087,11 +3087,16 @@ static int mp_property_packet_bitrate(void *ctx, struct m_property *prop, int type = (uintptr_t)prop->priv & ~0x100; bool old = (uintptr_t)prop->priv & 0x100; - if (!mpctx->demuxer) + struct demuxer *demuxer = NULL; + if (mpctx->current_track[0][type]) + demuxer = mpctx->current_track[0][type]->demuxer; + if (!demuxer) + demuxer = mpctx->demuxer; + if (!demuxer) return M_PROPERTY_UNAVAILABLE; double r[STREAM_TYPE_COUNT]; - if (demux_control(mpctx->demuxer, DEMUXER_CTRL_GET_BITRATE_STATS, &r) < 1) + if (demux_control(demuxer, DEMUXER_CTRL_GET_BITRATE_STATS, &r) < 1) return M_PROPERTY_UNAVAILABLE; if (r[type] < 0) return M_PROPERTY_UNAVAILABLE; -- cgit v1.2.3