mirror of https://git.ffmpeg.org/ffmpeg.git
AVFrame: only set parameters from AVCodecContext in decode_video*() when no frame reordering is used.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a3bc7a9ebf
commit
01d3ebaf21
|
@ -743,6 +743,8 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
|
||||||
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
|
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
|
||||||
avpkt);
|
avpkt);
|
||||||
picture->pkt_dts= avpkt->dts;
|
picture->pkt_dts= avpkt->dts;
|
||||||
|
|
||||||
|
if(!avctx->has_b_frames){
|
||||||
picture->pkt_pos= avpkt->pos;
|
picture->pkt_pos= avpkt->pos;
|
||||||
if (!picture->sample_aspect_ratio.num)
|
if (!picture->sample_aspect_ratio.num)
|
||||||
picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
|
picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
|
||||||
|
@ -753,6 +755,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
|
||||||
if (picture->format == PIX_FMT_NONE)
|
if (picture->format == PIX_FMT_NONE)
|
||||||
picture->format = avctx->pix_fmt;
|
picture->format = avctx->pix_fmt;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
emms_c(); //needed to avoid an emms_c() call before every return;
|
emms_c(); //needed to avoid an emms_c() call before every return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue