aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-01 14:10:20 +0200
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-07 11:45:37 +0200
commit18ded93ab3db5996cd86fe2f5b36ba3c4bd58711 (patch)
tree0444ed3f88a8d90d34bec1d93ea7cbfa9aa9ef01 /libavcodec/utils.c
parent22333a6b19f59ebc83933b910069d00c445d01ed (diff)
downloadffmpeg-18ded93ab3db5996cd86fe2f5b36ba3c4bd58711.tar.gz
lavc: add format field to AVFrame
The format is a per-frame property, having it in AVFrame simplify the operation of extraction of that information, since avoids the need to access the codec/stream context.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index dc26092dd1..5e0aa84ad0 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -456,6 +456,7 @@ void avcodec_get_frame_defaults(AVFrame *pic){
pic->pkt_pos = -1;
pic->key_frame= 1;
pic->sample_aspect_ratio = (AVRational){0, 1};
+ pic->format = -1; /* unknown */
}
AVFrame *avcodec_alloc_frame(void){
@@ -743,6 +744,8 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
picture->width = avctx->width;
if (!picture->height)
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;