diff options
author | Andrey Morozov <morozov.andrey.vmk@gmail.com> | 2014-05-07 15:55:02 -0300 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-06-01 17:27:17 +0200 |
commit | b5e40e15a3e35f0b48345b949a86f8862bca3b8b (patch) | |
tree | 73b3757f5839a44e2597dd524a68e25fc515db35 /demux | |
parent | ae09c0d8ebdf77beed10b35155bde776fe4b6866 (diff) | |
download | mpv-b5e40e15a3e35f0b48345b949a86f8862bca3b8b.tar.bz2 mpv-b5e40e15a3e35f0b48345b949a86f8862bca3b8b.tar.xz |
command: improve video-bitrate property
Signed-off-by: wm4 <wm4@nowhere>
Includes some cosmetic changes over the original PR.
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux_lavf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 9559c73260..0d33219dd9 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -477,7 +477,10 @@ static void handle_stream(demuxer_t *demuxer, int i) else sh_video->aspect = codec->width * codec->sample_aspect_ratio.num / (float)(codec->height * codec->sample_aspect_ratio.den); + sh_video->bitrate = codec->bit_rate; + if (sh_video->bitrate == 0) + sh_video->bitrate = avfc->bit_rate; AVDictionaryEntry *rot = av_dict_get(st->metadata, "rotate", NULL, 0); if (rot && rot->value) { |