Commit ab36dbec authored by gbazin's avatar gbazin
Browse files

* modules/codec/ffmpeg/*: fix interlaced encoding (top field first + repeat field.)

parent 95b4fba0
...@@ -608,11 +608,11 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict ) ...@@ -608,11 +608,11 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
/* Let ffmpeg select the frame type */ /* Let ffmpeg select the frame type */
frame.pict_type = 0; frame.pict_type = 0;
frame.repeat_pict = p_pict->i_nb_fields; frame.repeat_pict = 2 - p_pict->i_nb_fields;
#if LIBAVCODEC_BUILD >= 4685 #if LIBAVCODEC_BUILD >= 4685
frame.interlaced_frame = !p_pict->b_progressive; frame.interlaced_frame = !p_pict->b_progressive;
frame.top_field_first = p_pict->b_top_field_first; frame.top_field_first = !!p_pict->b_top_field_first;
#endif #endif
#if LIBAVCODEC_BUILD < 4702 #if LIBAVCODEC_BUILD < 4702
......
...@@ -646,7 +646,7 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block ) ...@@ -646,7 +646,7 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block )
p_pic->b_force = VLC_TRUE; p_pic->b_force = VLC_TRUE;
} }
p_pic->i_nb_fields = p_sys->p_ff_pic->repeat_pict; p_pic->i_nb_fields = 2 + p_sys->p_ff_pic->repeat_pict;
#if LIBAVCODEC_BUILD >= 4685 #if LIBAVCODEC_BUILD >= 4685
p_pic->b_progressive = !p_sys->p_ff_pic->interlaced_frame; p_pic->b_progressive = !p_sys->p_ff_pic->interlaced_frame;
p_pic->b_top_field_first = p_sys->p_ff_pic->top_field_first; p_pic->b_top_field_first = p_sys->p_ff_pic->top_field_first;
......
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