diff options
author | wm4 <wm4@nowhere> | 2015-10-23 14:58:01 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-10-23 14:58:01 +0200 |
commit | 56fefde7e2ee0c31e9d4d39b5bd0ca8a5643ebe5 (patch) | |
tree | 9a057e734d3857a0c62fe7d3fc6291c8f7c56bc2 /player/command.c | |
parent | 955c6843b6b7a491d1707104e5fad048cd1ab72c (diff) | |
download | mpv-56fefde7e2ee0c31e9d4d39b5bd0ca8a5643ebe5.tar.bz2 mpv-56fefde7e2ee0c31e9d4d39b5bd0ca8a5643ebe5.tar.xz |
command: make bitrate properties work correctly for external tracks
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 9 |
1 files 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; |