Commit 2b4bbd12 authored by Tomas Härdin's avatar Tomas Härdin Committed by Michael Niedermayer

dvdec: Move the VSC pack parsing to before avctx->execute()

This allows the next commit to parse the FS flag.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0ee57f8b
...@@ -343,6 +343,14 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, ...@@ -343,6 +343,14 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
s->picture.interlaced_frame = 1; s->picture.interlaced_frame = 1;
s->picture.top_field_first = 0; s->picture.top_field_first = 0;
/* Determine the codec's sample_aspect ratio from the packet */
vsc_pack = buf + 80*5 + 48 + 5;
if ( *vsc_pack == dv_video_control ) {
apt = buf[4] & 0x07;
is16_9 = (vsc_pack[2] & 0x07) == 0x02 || (!apt && (vsc_pack[2] & 0x07) == 0x07);
avctx->sample_aspect_ratio = s->sys->sar[is16_9];
}
s->buf = buf; s->buf = buf;
avctx->execute(avctx, dv_decode_video_segment, s->sys->work_chunks, NULL, avctx->execute(avctx, dv_decode_video_segment, s->sys->work_chunks, NULL,
dv_work_pool_size(s->sys), sizeof(DVwork_chunk)); dv_work_pool_size(s->sys), sizeof(DVwork_chunk));
...@@ -353,14 +361,6 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, ...@@ -353,14 +361,6 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
*data_size = sizeof(AVFrame); *data_size = sizeof(AVFrame);
*(AVFrame*)data = s->picture; *(AVFrame*)data = s->picture;
/* Determine the codec's sample_aspect ratio from the packet */
vsc_pack = buf + 80*5 + 48 + 5;
if ( *vsc_pack == dv_video_control ) {
apt = buf[4] & 0x07;
is16_9 = (vsc_pack[2] & 0x07) == 0x02 || (!apt && (vsc_pack[2] & 0x07) == 0x07);
avctx->sample_aspect_ratio = s->sys->sar[is16_9];
}
return s->sys->frame_size; return s->sys->frame_size;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment