[vlc-devel] [PATCH V2] transcode: handle return of aout_FiltersPlay()

Thomas Guillem thomas at gllm.fr
Fri Mar 1 13:10:27 CET 2019


Returning NULL is not an error, a lot of filters do return NULL waiting for more data.
Handle vlc_block_discontinuity as an error.
---
 modules/stream_out/transcode/audio.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index 82578c9077..b9f3827397 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -337,8 +337,13 @@ int transcode_audio_process( sout_stream_t *p_stream,
 
         /* Run filter chain */
         p_audio_buf = aout_FiltersPlay( id->p_af_chain, p_audio_buf, 1.f );
-        if( !p_audio_buf )
-            goto error;
+        if( !p_audio_buf  )
+            continue;
+        if( p_audio_buf == vlc_block_discontinuity)
+        {
+            id->b_error = true;
+            break;
+        }
 
         p_audio_buf->i_dts = p_audio_buf->i_pts;
 
-- 
2.20.1



More information about the vlc-devel mailing list