diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-04-29 13:04:47 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-12-25 16:18:57 +0100 |
commit | b58dbb5b031c33cdb88f13cc533f623e82cdbcbd (patch) | |
tree | 1bb0334e817102f10c84466ccdad4a931ccb0f05 /libavcodec/utils.c | |
parent | 671005558a295945f5d4cfd1abca6832af479c0b (diff) | |
download | ffmpeg-b58dbb5b031c33cdb88f13cc533f623e82cdbcbd.tar.gz |
lavc: add a sample_aspect_ratio field to AVFrame
The sample aspect ratio is a per-frame property, so it makes sense to
define it in AVFrame rather than in the codec/stream context.
Simplify application-level sample aspect ratio information extraction,
and allow further simplifications.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 7e9ddb2e35..7c1a7aea2a 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -584,6 +584,7 @@ void avcodec_get_frame_defaults(AVFrame *pic){ pic->pts= AV_NOPTS_VALUE; pic->key_frame= 1; + pic->sample_aspect_ratio = (AVRational){0, 1}; } AVFrame *avcodec_alloc_frame(void){ @@ -858,6 +859,7 @@ 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; + picture->sample_aspect_ratio = avctx->sample_aspect_ratio; } emms_c(); //needed to avoid an emms_c() call before every return; |