[vlc-devel] [PATCH 2/3] packetizer: h264: set interlacing flags

Francois Cartegnie fcvlcdev at free.fr
Wed Mar 25 23:11:28 CET 2015


---
 modules/packetizer/h264.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index b8a9d5b..89cca0b 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -760,6 +760,35 @@ static block_t *OutputPicture( decoder_t *p_dec )
     if( !p_sys->b_header )
         p_pic->i_flags |= BLOCK_FLAG_PREROLL;
 
+    if( p_sys->b_frame_mbs_only == 0 && p_sys->b_pic_struct_present_flag )
+    {
+        switch( p_sys->i_pic_struct )
+        {
+        case 1:
+            if( p_sys->i_fields_dts == 2 )
+                p_pic->i_flags |= BLOCK_FLAG_TOP_FIELD_FIRST;
+            else
+                p_pic->i_flags |= BLOCK_FLAG_BOTTOM_FIELD_FIRST;
+            break;
+        case 3:
+        case 5:
+            p_pic->i_flags |= BLOCK_FLAG_TOP_FIELD_FIRST;
+            break;
+        case 2:
+            if( p_sys->i_fields_dts == 2 )
+                p_pic->i_flags |= BLOCK_FLAG_BOTTOM_FIELD_FIRST;
+            else
+                p_pic->i_flags |= BLOCK_FLAG_TOP_FIELD_FIRST;
+            break;
+        case 4:
+        case 6:
+            p_pic->i_flags |= BLOCK_FLAG_BOTTOM_FIELD_FIRST;
+            break;
+        default:
+            break;
+        }
+    }
+
     p_sys->slice.i_frame_type = 0;
     p_sys->p_frame = NULL;
     p_sys->i_frame_dts = VLC_TS_INVALID;
-- 
2.1.0




More information about the vlc-devel mailing list