[vlc-commits] transcode: send blocks on error

Francois Cartegnie git at videolan.org
Mon Jul 9 16:15:58 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Jul  8 14:27:01 2018 +0200| [e12f30336ef30986cc09779babe3a24b5d12d563] | committer: Francois Cartegnie

transcode: send blocks on error

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

 modules/stream_out/transcode/transcode.c | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/modules/stream_out/transcode/transcode.c b/modules/stream_out/transcode/transcode.c
index 2f45bc4b07..02acb5ec49 100644
--- a/modules/stream_out/transcode/transcode.c
+++ b/modules/stream_out/transcode/transcode.c
@@ -694,39 +694,30 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
             goto error;
     }
 
+    int i_ret;
     switch( id->p_decoder->fmt_in.i_cat )
     {
     case AUDIO_ES:
-        if( transcode_audio_process( p_stream, id, p_buffer, &p_out )
-            != VLC_SUCCESS )
-        {
-            return VLC_EGENERIC;
-        }
+        i_ret = transcode_audio_process( p_stream, id, p_buffer, &p_out );
         break;
 
     case VIDEO_ES:
-        if( transcode_video_process( p_stream, id, p_buffer, &p_out )
-            != VLC_SUCCESS )
-        {
-            return VLC_EGENERIC;
-        }
+        i_ret = transcode_video_process( p_stream, id, p_buffer, &p_out );
         break;
 
     case SPU_ES:
-        if ( transcode_spu_process( p_stream, id, p_buffer, &p_out ) !=
-            VLC_SUCCESS )
-        {
-            return VLC_EGENERIC;
-        }
+        i_ret = transcode_spu_process( p_stream, id, p_buffer, &p_out );
         break;
 
     default:
         goto error;
     }
 
-    if( p_out )
-        return sout_StreamIdSend( p_stream->p_next, id->downstream_id, p_out );
-    return VLC_SUCCESS;
+    if( p_out &&
+        sout_StreamIdSend( p_stream->p_next, id->downstream_id, p_out ) )
+        i_ret = VLC_EGENERIC;
+
+    return i_ret;
 error:
     if( p_buffer )
         block_Release( p_buffer );



More information about the vlc-commits mailing list