[vlc-commits] transcode/video: refactor error handling

Thomas Guillem git at videolan.org
Fri Jan 19 12:01:42 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jan 18 18:47:34 2018 +0100| [fb1d45f87b07d3a888ce72ad423fddd413a7d867] | committer: Jean-Baptiste Kempf

transcode/video: refactor error handling

(cherry picked from commit cb1b1634b812dc7f6d30c73216dfd49230448279)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/stream_out/transcode/video.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 1f62be9da0..c59968ab71 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -826,12 +826,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
             memcpy( &id->fmt_input_video, &p_pic->format, sizeof(video_format_t));
 
             if( transcode_video_encoder_open( p_stream, id ) != VLC_SUCCESS )
-            {
-                picture_Release( p_pic );
-                id->b_transcode = false;
-                b_error = true;
-                continue;
-            }
+                goto error;
         }
 
         /* Run the filter and output chains; first with the picture,
@@ -863,6 +858,12 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
 
             p_pic = NULL;
         }
+        continue;
+error:
+        if( p_pic )
+            picture_Release( p_pic );
+        id->b_transcode = false;
+        b_error = true;
     } while( p_pics );
 
     if( p_sys->i_threads >= 1 )



More information about the vlc-commits mailing list