avformat/utils: never decrease has_b_frames in compute_pkt_fields()
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 3 Nov 2013 20:26:40 +0000 (21:26 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 3 Nov 2013 20:36:10 +0000 (21:36 +0100)
The intent of the original check was to increase has_b_frames when
it was incorrectly set to 0. Later codecs allowed larger values

Found-by: divVerent
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index 3bb837a..5637d17 100644 (file)
@@ -1039,7 +1039,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
     if((s->flags & AVFMT_FLAG_IGNDTS) && pkt->pts != AV_NOPTS_VALUE)
         pkt->dts= AV_NOPTS_VALUE;
 
-    if (st->codec->codec_id != AV_CODEC_ID_H264 && pc && pc->pict_type == AV_PICTURE_TYPE_B)
+    if (pc && pc->pict_type == AV_PICTURE_TYPE_B
+        && !st->codec->has_b_frames)
         //FIXME Set low_delay = 0 when has_b_frames = 1
         st->codec->has_b_frames = 1;