[FFmpeg-devel] [PATCH]lavd/decklink_dec: Make bitrate calculation 64bit

Carl Eugen Hoyos cehoyos at ag.or.at
Thu Apr 28 17:27:44 CEST 2016


Hi!

I hope attached patch fixes an issue seen in a decklink user report where 
the bit_rate was negative. Or should the division be changed to 1ULL/...?
Completely untested.

Please review, Carl Eugen
-------------- next part --------------
diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 9d7dc97..89c1a8b 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -569,7 +569,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
 
     st->codec->time_base.den      = ctx->bmd_tb_den;
     st->codec->time_base.num      = ctx->bmd_tb_num;
-    st->codec->bit_rate    = av_image_get_buffer_size(st->codec->pix_fmt, ctx->bmd_width, ctx->bmd_height, 1) * 1/av_q2d(st->codec->time_base) * 8;
+    st->codec->bit_rate    = av_image_get_buffer_size(st->codec->pix_fmt, ctx->bmd_width, ctx->bmd_height, 1) * 1/av_q2d(st->codec->time_base) * 8ULL;
 
     if (cctx->v210) {
         st->codec->codec_id    = AV_CODEC_ID_V210;


More information about the ffmpeg-devel mailing list