[vlc-devel] [PATCH] sout: transcode: check linear format after assignment

quinkblack at foxmail.com quinkblack at foxmail.com
Fri Oct 4 05:40:58 CEST 2019


From: Zhao Zhili <zhilizhao at tencent.com>

fix flac transcode failure
---
 modules/stream_out/transcode/audio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index 9d2c956b04..edc683a2e1 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -43,12 +43,12 @@ 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 );
 
+    if( !AOUT_FMT_LINEAR(&p_dec->fmt_out.audio) )
+        return VLC_EGENERIC;
+
     vlc_mutex_lock(&id->fifo.lock);
     es_format_Clean( &id->decoder_out );
     es_format_Copy( &id->decoder_out, &p_dec->fmt_out );
-- 
2.17.1





More information about the vlc-devel mailing list