]> git.sesse.net Git - vlc/commitdiff
* modules/stream_out/transcode.c: Fixed --sout-transcode-threads=1 option
authorChristophe Massiot <massiot@videolan.org>
Tue, 1 Mar 2005 17:30:50 +0000 (17:30 +0000)
committerChristophe Massiot <massiot@videolan.org>
Tue, 1 Mar 2005 17:30:50 +0000 (17:30 +0000)
  (what the hell is i_duplicate ?)

modules/stream_out/transcode.c

index 0e24bba283f3d9495a797ab887e4289c21ed127f..55707a21ef6039440efb8bd72429b2d55d5fe820 100644 (file)
@@ -1658,7 +1658,6 @@ static int EncoderThread( sout_stream_sys_t *p_sys )
 {
     sout_stream_id_t *id = p_sys->id_video;
     picture_t *p_pic;
-    int i_plane;
 
     while( !p_sys->b_die && !p_sys->b_error )
     {
@@ -1683,13 +1682,23 @@ static int EncoderThread( sout_stream_sys_t *p_sys )
         p_block = id->p_encoder->pf_encode_video( id->p_encoder, p_pic );
         vlc_mutex_lock( &p_sys->lock_out );
         block_ChainAppend( &p_sys->p_buffers, p_block );
-        vlc_mutex_unlock( &p_sys->lock_out );
 
-        for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )
+        if( p_sys->b_master_sync )
+            date_Increment( &id->interpolated_pts, 1 );
+
+#if 0
+        if( p_sys->b_master_sync && i_duplicate > 1 )
         {
-            free( p_pic->p[i_plane].p_pixels );
+            mtime_t i_pts = date_Get( &id->interpolated_pts ) + 1;
+            date_Increment( &id->interpolated_pts, 1 );
+            p_pic->date = i_pts;
+            p_block = id->p_encoder->pf_encode_video(id->p_encoder, p_pic);
+            block_ChainAppend( &p_sys->p_buffers, p_block );
         }
-        free( p_pic );
+#endif
+        vlc_mutex_unlock( &p_sys->lock_out );
+
+        p_pic->pf_release( p_pic );
     }
 
     while( p_sys->i_last_pic != p_sys->i_first_pic )
@@ -1697,11 +1706,7 @@ static int EncoderThread( sout_stream_sys_t *p_sys )
         p_pic = p_sys->pp_pics[p_sys->i_first_pic++];
         p_sys->i_first_pic %= PICTURE_RING_SIZE;
 
-        for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )
-        {
-            free( p_pic->p[i_plane].p_pixels );
-        }
-        free( p_pic );
+        p_pic->pf_release( p_pic );
     }
 
     block_ChainRelease( p_sys->p_buffers );