diff options
author | Arpi <arpi@thot.banki.hu> | 2002-11-10 18:45:36 +0000 |
---|---|---|
committer | Arpi <arpi@thot.banki.hu> | 2002-11-10 18:45:36 +0000 |
commit | df1c67addae53ba2d5ab1bc66700da78506c993e (patch) | |
tree | ea643c56cdf3a2a344651d6e359549f7a06524b1 | |
parent | b8a78f419dd67cebc70f78e3d183c7eb4ed10c0e (diff) | |
download | ffmpeg-df1c67addae53ba2d5ab1bc66700da78506c993e.tar.gz |
10l - set pixelfmt (colorspace) _before_ calling get_buffer() callback
Originally committed as revision 1185 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/dv.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 44ee843823..2473dd2415 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -531,10 +531,12 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, /* init size */ width = 720; if (dsf) { + avctx->frame_rate = 25 * FRAME_RATE_BASE; packet_size = PAL_FRAME_SIZE; height = 576; nb_dif_segs = 12; } else { + avctx->frame_rate = 30 * FRAME_RATE_BASE; packet_size = NTSC_FRAME_SIZE; height = 480; nb_dif_segs = 10; @@ -546,10 +548,16 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, /* XXX: is it correct to assume that 420 is always used in PAL mode ? */ s->sampling_411 = !dsf; - if (s->sampling_411) + if (s->sampling_411) { mb_pos_ptr = dv_place_411; - else + avctx->pix_fmt = PIX_FMT_YUV411P; + } else { mb_pos_ptr = dv_place_420; + avctx->pix_fmt = PIX_FMT_YUV420P; + } + + avctx->width = width; + avctx->height = height; if (avctx->flags & CODEC_FLAG_DR1 && avctx->get_buffer_callback) { @@ -561,7 +569,6 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, } } - /* (re)alloc picture if needed */ if (s->width != width || s->height != height) { if (!(avctx->flags & CODEC_FLAG_DR1)) @@ -610,16 +617,6 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, emms_c(); /* return image */ - avctx->width = width; - avctx->height = height; - if (s->sampling_411) - avctx->pix_fmt = PIX_FMT_YUV411P; - else - avctx->pix_fmt = PIX_FMT_YUV420P; - if (dsf) - avctx->frame_rate = 25 * FRAME_RATE_BASE; - else - avctx->frame_rate = 30 * FRAME_RATE_BASE; *data_size = sizeof(AVPicture); picture = data; for(i=0;i<3;i++) { |