diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-14 15:30:12 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-14 15:30:12 +0100 |
commit | 86b4dc6277691781015000763563d1baf212cdc7 (patch) | |
tree | f4d95e42479b9c51ea8301f45a4f4575870d61fa /libavcodec/utils.c | |
parent | 3b5c0f5e362f2ba7077e34e47e64dedd5f705dcb (diff) | |
parent | bd255f9feb4deea4c990e582f0ba3b90d7b64b4c (diff) | |
download | ffmpeg-streaming-86b4dc6277691781015000763563d1baf212cdc7.zip ffmpeg-streaming-86b4dc6277691781015000763563d1baf212cdc7.tar.gz |
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>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 5ec99d0..dcf81e6 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1611,16 +1611,19 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi else { ret = avctx->codec->decode(avctx, picture, got_picture_ptr, &tmp); - picture->pkt_dts = avpkt->dts; + picture->pkt_dts = avpkt->dts; if(!avctx->has_b_frames){ picture->pkt_pos = avpkt->pos; } //FIXME these should be under if(!avctx->has_b_frames) - if (!picture->sample_aspect_ratio.num) picture->sample_aspect_ratio = avctx->sample_aspect_ratio; - 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; + /* get_buffer is supposed to set frame parameters */ + if (!(avctx->codec->capabilities & CODEC_CAP_DR1)) { + if (!picture->sample_aspect_ratio.num) picture->sample_aspect_ratio = avctx->sample_aspect_ratio; + 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); |