[vlc-commits] sout: transcode: check linear format using macro

Francois Cartegnie git at videolan.org
Mon Jul 23 15:37:41 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jul 20 20:13:18 2018 +0200| [79c8a34d1ab19af19cf6042be49fc6ef734d3335] | committer: Francois Cartegnie

sout: transcode: check linear format using macro

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

 modules/stream_out/transcode/audio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index 86a0dfe339..b2c3c08749 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -45,6 +45,9 @@ static int audio_update_format( decoder_t *p_dec )
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
     sout_stream_id_sys_t *id = p_owner->id;
 
+    if( !AOUT_FMT_LINEAR(&p_dec->fmt_out.audio) )
+        return VLC_EGENERIC;
+
     p_dec->fmt_out.audio.i_format = p_dec->fmt_out.i_codec;
     aout_FormatPrepare( &p_dec->fmt_out.audio );
 
@@ -53,7 +56,7 @@ static int audio_update_format( decoder_t *p_dec )
     es_format_Copy( &id->decoder_out, &p_dec->fmt_out );
     vlc_mutex_unlock(&id->fifo.lock);
 
-    return ( p_dec->fmt_out.audio.i_bitspersample > 0 ) ? 0 : -1;
+    return VLC_SUCCESS;
 }
 
 static int transcode_audio_filters_init( sout_stream_t *p_stream,



More information about the vlc-commits mailing list