AVFrame: only set parameters from AVCodecContext in decode_video*() when no frame...
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 13 May 2011 22:11:10 +0000 (00:11 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 13 May 2011 22:16:49 +0000 (00:16 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index 6ec8add..b61f9b7 100644 (file)
@@ -743,6 +743,8 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
             ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
                               avpkt);
             picture->pkt_dts= avpkt->dts;
+
+            if(!avctx->has_b_frames){
             picture->pkt_pos= avpkt->pos;
             if (!picture->sample_aspect_ratio.num)
                 picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
@@ -752,6 +754,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
                 picture->height = avctx->height;
             if (picture->format == PIX_FMT_NONE)
                 picture->format = avctx->pix_fmt;
+            }
         }
 
         emms_c(); //needed to avoid an emms_c() call before every return;