[vlc-commits] transcode: fix error handling

Thomas Guillem git at videolan.org
Wed Jan 24 08:46:24 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jan 22 08:47:49 2018 +0100| [143049a2aa9089edc587489292553de363fb0290] | committer: Jean-Baptiste Kempf

transcode: fix error handling

Forget a b_error case. Regression from 67e993164249d81bb38bf3f3030238d04d36b176

CID #1427674 #1427673

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

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

 modules/stream_out/transcode/audio.c | 5 ++---
 modules/stream_out/transcode/video.c | 6 +++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index c7ce848239..f6d436bff3 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -269,7 +269,6 @@ int transcode_audio_process( sout_stream_t *p_stream,
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
     *out = NULL;
-    bool b_error = false;
 
     int ret = id->p_decoder->pf_decode( id->p_decoder, in );
     if( ret != VLCDEC_SUCCESS )
@@ -385,7 +384,7 @@ error:
 
 end:
     /* Drain encoder */
-    if( unlikely( !b_error && in == NULL ) )
+    if( unlikely( !id->b_error && in == NULL ) )
     {
         if( id->p_encoder->p_module )
         {
@@ -397,7 +396,7 @@ end:
         }
     }
 
-    return b_error ? VLC_EGENERIC : VLC_SUCCESS;
+    return id->b_error ? VLC_EGENERIC : VLC_SUCCESS;
 }
 
 bool transcode_audio_add( sout_stream_t *p_stream, const es_format_t *p_fmt,
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index c9d3ed187e..779ff7c6eb 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -761,7 +761,6 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
     *out = NULL;
-    bool b_error = false;
 
     int ret = id->p_decoder->pf_decode( id->p_decoder, in );
     if( ret != VLCDEC_SUCCESS )
@@ -878,7 +877,8 @@ error:
     }
 
 end:
-    if( unlikely( in == NULL ) )
+    /* Drain encoder */
+    if( unlikely( !id->b_error && in == NULL ) )
     {
         if( p_sys->i_threads == 0 )
         {
@@ -909,7 +909,7 @@ end:
         }
     }
 
-    return b_error ? VLC_EGENERIC : VLC_SUCCESS;
+    return id->b_error ? VLC_EGENERIC : VLC_SUCCESS;
 }
 
 bool transcode_video_add( sout_stream_t *p_stream, const es_format_t *p_fmt,



More information about the vlc-commits mailing list