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, 17 Nov 2013 18:11:07 +0000 (19:11 +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>
(cherry picked from commit 8b73a3f6f6598cb9249034fa020ddead3c943e2f)

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

index 2658136..04984a1 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;