[vlc-devel] commit: This should fix audio transcoding. ( unfortunately I have some issues (Antoine Cellerier )
git version control
git at videolan.org
Thu Jun 5 00:01:07 CEST 2008
vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Thu Jun 5 00:02:42 2008 +0200| [3c5c04601e89885ce961a766d85cffe9ab5b375a]
This should fix audio transcoding. (unfortunately I have some issues
a bit later ... but at least it gives a starting point for people
wanting to have fun with transcode / audio / filter chains)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3c5c04601e89885ce961a766d85cffe9ab5b375a
---
modules/stream_out/transcode.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/modules/stream_out/transcode.c b/modules/stream_out/transcode.c
index 7458849..bc3bd23 100644
--- a/modules/stream_out/transcode.c
+++ b/modules/stream_out/transcode.c
@@ -1215,7 +1215,7 @@ static int transcode_audio_new( sout_stream_t *p_stream,
audio_BitsPerSample( id->p_encoder->fmt_in.i_codec );
/* Init filter chain */
- id->p_f_chain = filter_chain_New( p_stream, "audio filter2", false,
+ id->p_f_chain = filter_chain_New( p_stream, "audio filter2", true,
transcode_audio_filter_allocation_init, NULL, NULL );
filter_chain_Reset( id->p_f_chain, &fmt_last, &id->p_encoder->fmt_in );
@@ -1230,6 +1230,20 @@ static int transcode_audio_new( sout_stream_t *p_stream,
fmt_last = fmt_out;
}
+ /* FIXME: same comment as in "#if 0"ed code */
+ int i;
+ for( i = 0; i < 4; i++ )
+ {
+ if( (fmt_last.audio.i_channels !=
+ id->p_encoder->fmt_in.audio.i_channels) ||
+ (fmt_last.audio.i_rate != id->p_encoder->fmt_in.audio.i_rate) ||
+ (fmt_last.i_codec != id->p_encoder->fmt_in.i_codec) )
+ {
+ filter_chain_AppendFilter( id->p_f_chain, NULL, NULL, &fmt_last, &id->p_encoder->fmt_in );
+ fmt_last = *filter_chain_GetFmtOut( id->p_f_chain );
+ }
+ }
+
#if 0
/* FIXME FIXME FIXME WHAT DOES THIS CODE DO? LOOKS LIKE IT'S RANDOMLY TRYING
TO CHAIN A BUNCH OF AUDIO FILTERS */
More information about the vlc-devel
mailing list