[vlc-devel] [PATCH] mono: Specify the expected format rather than failing

Hugo Beauzée-Luyssen hugo at beauzee.fr
Mon Jun 16 23:26:33 CEST 2014


Hi,

As reported on IRC by a user, using the mono audio filter fails (silently) when
the input format differs from S16N.
This patches hints about this rather than failing immediatly, and will let the
audio filter chain fail if appropriate.

There might be a reason for this to behave as such, or I just might be missing
something as I don't know much about the audio pipeline, so feel free to flame
me gently if this is a non-sense :)

Regards,

---
 modules/audio_filter/channel_mixer/mono.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/modules/audio_filter/channel_mixer/mono.c b/modules/audio_filter/channel_mixer/mono.c
index bafda10..0bb71cc 100644
--- a/modules/audio_filter/channel_mixer/mono.c
+++ b/modules/audio_filter/channel_mixer/mono.c
@@ -347,13 +347,8 @@ static int OpenFilter( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    if( (p_filter->fmt_in.audio.i_format != p_filter->fmt_out.audio.i_format) ||
-        (p_filter->fmt_in.audio.i_format != VLC_CODEC_S16N) ||
-        (p_filter->fmt_out.audio.i_format != VLC_CODEC_S16N) )
-    {
-        /*msg_Err( p_this, "couldn't load mono filter" );*/
-        return VLC_EGENERIC;
-    }
+    p_filter->fmt_in.audio.i_format = VLC_CODEC_S16N;
+    p_filter->fmt_out.audio.i_format = VLC_CODEC_S16N;
 
     /* Allocate the memory needed to store the module's structure */
     p_sys = p_filter->p_sys = malloc( sizeof(filter_sys_t) );
-- 
2.0.0




More information about the vlc-devel mailing list