vlc | branch: master | Francois Cartegnie <[email protected]> | Wed Mar 25 
23:11:28 2015 +0100| [b7b9ddb4b45f475523d202228acc43aedcec7c7a] | committer: 
Francois Cartegnie

packetizer: h264: set interlacing flags

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b7b9ddb4b45f475523d202228acc43aedcec7c7a
---

 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;

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to