]> git.sesse.net Git - vlc/blobdiff - modules/codec/rawvideo.c
macosx/framework: Fix three leaks in VLCStreamOutput.
[vlc] / modules / codec / rawvideo.c
index d6998325d1d73fb7cdd63c013a5dba9b417ac706..27b0b0238bc510d9d76501e6b8b2c0b0c056b24d 100644 (file)
@@ -205,7 +205,8 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     p_block = *pp_block;
 
 
-    if( !p_block->i_pts && !p_block->i_dts && !date_Get( &p_sys->pts ) )
+    if( p_block->i_pts <= VLC_TS_INVALID && p_block->i_dts <= VLC_TS_INVALID &&
+        !date_Get( &p_sys->pts ) )
     {
         /* We've just started the stream, wait for the first PTS. */
         block_Release( p_block );
@@ -213,11 +214,11 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     }
 
     /* Date management: If there is a pts avaliable, use that. */
-    if( p_block->i_pts )
+    if( p_block->i_pts > VLC_TS_INVALID )
     {
         date_Set( &p_sys->pts, p_block->i_pts );
     }
-    else if( p_block->i_dts )
+    else if( p_block->i_dts > VLC_TS_INVALID )
     {
         /* NB, davidf doesn't quite agree with this in general, it is ok
          * for rawvideo since it is in order (ie pts=dts), however, it
@@ -298,7 +299,17 @@ static picture_t *DecodeFrame( decoder_t *p_dec, block_t *p_block )
     FillPicture( p_dec, p_block, p_pic );
 
     p_pic->date = date_Get( &p_sys->pts );
-    p_pic->b_progressive = true;
+    if( p_block->i_flags & BLOCK_FLAG_INTERLACED_MASK )
+    {
+        p_pic->b_progressive = false;
+        p_pic->i_nb_fields = 2;
+        if( p_block->i_flags & BLOCK_FLAG_TOP_FIELD_FIRST )
+            p_pic->b_top_field_first = true;
+        else
+            p_pic->b_top_field_first = false;
+    }
+    else
+        p_pic->b_progressive = true;
 
     block_Release( p_block );
     return p_pic;