[vlc-commits] commit: transcode: use bool instead of int to inform if we need to copy picture ( Ilkka Ollakka )

git at videolan.org git at videolan.org
Tue May 25 19:03:16 CEST 2010


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Tue May 25 17:18:37 2010 +0300| [49132d8e10cb6da496aa25ba107af8dc71d2580e] | committer: Ilkka Ollakka 

transcode: use bool instead of int to inform if we need to copy picture

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

 modules/stream_out/transcode/video.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 1956c65..9b16ae6 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -590,7 +590,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
                                     block_t *in, block_t **out )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
-    int i_duplicate = 1;
+    bool b_need_duplicate = false;
     picture_t *p_pic, *p_pic2 = NULL;
     *out = NULL;
 
@@ -640,7 +640,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
                 i_pts = p_pic->date + 1;
             }
             i_video_drift = p_pic->date - i_pts;
-            i_duplicate = 1;
+            b_need_duplicate = false;
 
             /* Set the pts of the frame being encoded */
             p_pic->date = i_pts;
@@ -660,7 +660,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
                 msg_Dbg( p_stream, "adding frame (%i)",
                          (int)(i_video_drift - i_master_drift) );
 #endif
-                i_duplicate = 2;
+                b_need_duplicate = true;
             }
         }
 
@@ -748,7 +748,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
             }
             date_Increment( &id->interpolated_pts, 1 );
 
-            if( i_duplicate > 1 )
+            if( unlikely( b_need_duplicate ) )
             {
 
                if( p_sys->i_threads >= 1 )



More information about the vlc-commits mailing list