[FFmpeg-devel] [PATCH 6/8] avcodec/decode: Do not overwrite AVFrame.pkt_pos if its already set

Michael Niedermayer michael at niedermayer.cc
Mon Aug 12 22:17:06 EEST 2019


Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/decode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 6c31166ec2..09a509d659 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -435,7 +435,7 @@ static int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame)
         if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS))
             frame->pkt_dts = pkt->dts;
         if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) {
-            if(!avctx->has_b_frames)
+            if(!avctx->has_b_frames && frame->pkt_pos < 0)
                 frame->pkt_pos = pkt->pos;
             //FIXME these should be under if(!avctx->has_b_frames)
             /* get_buffer is supposed to set frame parameters */
-- 
2.22.0



More information about the ffmpeg-devel mailing list