aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Foucu2009-02-12 00:08:44 +0000
committerBaptiste Coudurier2009-02-12 00:08:44 +0000
commit68a7aafff6ccb3c930bfa137a2c76881177a46d3 (patch)
tree14d2ff46ca90b37bd7270cb034cf53919f5118b5
parent70bf0416cfc15746d008a7069e6704eef818af02 (diff)
compute b_per_i_or_p value correctly, patch by Thierry Foucu, tfoucu at gmail dot com
Originally committed as revision 17166 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/gxfenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index fd72bd090d..73c836024a 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -175,8 +175,11 @@ static int gxf_write_mpeg_auxiliary(ByteIOContext *pb, GXFStreamContext *ctx)
ctx->p_per_gop = ctx->pframes / ctx->iframes;
if (ctx->pframes % ctx->iframes)
ctx->p_per_gop++;
- if (ctx->pframes)
+ if (ctx->pframes) {
ctx->b_per_i_or_p = ctx->bframes / ctx->pframes;
+ if (ctx->bframes % ctx->pframes)
+ ctx->b_per_i_or_p++;
+ }
if (ctx->p_per_gop > 9)
ctx->p_per_gop = 9; /* ensure value won't take more than one char */
if (ctx->b_per_i_or_p > 9)