1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

Merge commit 'bd255f9feb4deea4c990e582f0ba3b90d7b64b4c'

* commit 'bd255f9feb4deea4c990e582f0ba3b90d7b64b4c':
  lavc: set frame parameters after decoding only if necessary

Conflicts:
	libavcodec/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-12-14 15:30:12 +01:00
commit 86b4dc6277

View File

@ -1611,16 +1611,19 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
else { else {
ret = avctx->codec->decode(avctx, picture, got_picture_ptr, ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
&tmp); &tmp);
picture->pkt_dts = avpkt->dts; picture->pkt_dts = avpkt->dts;
if(!avctx->has_b_frames){ if(!avctx->has_b_frames){
picture->pkt_pos = avpkt->pos; picture->pkt_pos = avpkt->pos;
} }
//FIXME these should be under if(!avctx->has_b_frames) //FIXME these should be under if(!avctx->has_b_frames)
if (!picture->sample_aspect_ratio.num) picture->sample_aspect_ratio = avctx->sample_aspect_ratio; /* get_buffer is supposed to set frame parameters */
if (!picture->width) picture->width = avctx->width; if (!(avctx->codec->capabilities & CODEC_CAP_DR1)) {
if (!picture->height) picture->height = avctx->height; if (!picture->sample_aspect_ratio.num) picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
if (picture->format == AV_PIX_FMT_NONE) picture->format = avctx->pix_fmt; if (!picture->width) picture->width = avctx->width;
if (!picture->height) picture->height = avctx->height;
if (picture->format == AV_PIX_FMT_NONE) picture->format = avctx->pix_fmt;
}
} }
add_metadata_from_side_data(avctx, picture); add_metadata_from_side_data(avctx, picture);