[vlc-commits] transcode: try FI32 as intermediate format

Rafaël Carré git at videolan.org
Tue Sep 4 14:26:41 CEST 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue Sep  4 00:46:17 2012 +0200| [bc3dd56dca6d17b667eaa0edd859815d38c216d4] | committer: Rafaël Carré

transcode: try FI32 as intermediate format

Some formats can only be converted to FI32, and then
a FI32->FL32 converter can be used.

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

 modules/stream_out/transcode/audio.c |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index f54aa5f..f8b0f45 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -114,8 +114,25 @@ static int transcode_audio_filter_chain_build( sout_stream_t *p_stream, filter_c
 
         if( !filter_chain_AppendFilter( p_chain, NULL, NULL, NULL, &current ) )
         {
-            msg_Err( p_stream, "Failed to find conversion filter to fl32" );
-            return VLC_EGENERIC;
+            /* If that fails, try going through fi32 */
+            current.i_codec =
+                current.audio.i_format = VLC_CODEC_FI32;
+            aout_FormatPrepare( &current.audio );
+
+            if( !filter_chain_AppendFilter( p_chain, NULL, NULL, NULL, &current ) )
+            {
+                msg_Err( p_stream, "Failed to find conversion filter to fi32" );
+                return VLC_EGENERIC;
+            }
+            current = *filter_chain_GetFmtOut( p_chain );
+            current.i_codec =
+                current.audio.i_format = VLC_CODEC_FL32;
+            aout_FormatPrepare( &current.audio );
+            if( !filter_chain_AppendFilter( p_chain, NULL, NULL, NULL, &current ) )
+            {
+                msg_Err( p_stream, "Failed to find conversion filter to fl32" );
+                return VLC_EGENERIC;
+            }
         }
         current = *filter_chain_GetFmtOut( p_chain );
     }



More information about the vlc-commits mailing list