Commit 33203a08 authored by Baptiste Coudurier's avatar Baptiste Coudurier

avcodec/dvdec: correctly set interlaced and tff

parent c54268ce
...@@ -542,13 +542,20 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, void *data, ...@@ -542,13 +542,20 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, void *data,
if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret; return ret;
frame.f->interlaced_frame = 1;
frame.f->top_field_first = 0;
/* Determine the codec's field order from the packet */ /* Determine the codec's field order from the packet */
if ( *vsc_pack == dv_video_control ) { if ( *vsc_pack == dv_video_control ) {
if (avctx->height == 720) {
frame.f->interlaced_frame = 0;
frame.f->top_field_first = 0;
} else if (avctx->height == 1080) {
frame.f->interlaced_frame = 1;
frame.f->top_field_first = (vsc_pack[3] & 0x40) == 0x40;
} else {
frame.f->interlaced_frame = (vsc_pack[3] & 0x10) == 0x10;
frame.f->top_field_first = !(vsc_pack[3] & 0x40); frame.f->top_field_first = !(vsc_pack[3] & 0x40);
} }
}
s->buf = buf; s->buf = buf;
avctx->execute(avctx, dv_decode_video_segment, s->work_chunks, NULL, avctx->execute(avctx, dv_decode_video_segment, s->work_chunks, NULL,
......
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