[FFmpeg-cvslog] avformat/utils: never decrease has_b_frames in compute_pkt_fields()

Michael Niedermayer git at videolan.org
Sun Nov 17 20:06:24 CET 2013


ffmpeg | branch: release/2.1 | Michael Niedermayer <michaelni at gmx.at> | Sun Nov  3 21:26:40 2013 +0100| [8c00647982590115b9dedb9cc42bec70c0531782] | committer: Michael Niedermayer

avformat/utils: never decrease has_b_frames in compute_pkt_fields()

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 at gmx.at>
(cherry picked from commit 8b73a3f6f6598cb9249034fa020ddead3c943e2f)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8c00647982590115b9dedb9cc42bec70c0531782
---

 libavformat/utils.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 2658136..04984a1 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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;
 



More information about the ffmpeg-cvslog mailing list