visualization: fix output formats
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 19 Dec 2012 19:09:02 +0000 (21:09 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 19 Dec 2012 19:09:46 +0000 (21:09 +0200)
modules/visualization/goom.c
modules/visualization/projectm.cpp
modules/visualization/vsxu.cpp

index 175c048..aab6c58 100644 (file)
@@ -119,21 +119,12 @@ static int Open( vlc_object_t *p_this )
     goom_thread_t  *p_thread;
     video_format_t fmt;
 
-
-    if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 ||
-         p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )
-    {
-        msg_Warn( p_filter, "bad input or output format" );
-        return VLC_EGENERIC;
-    }
-    if( !AOUT_FMTS_SIMILAR( &p_filter->fmt_in.audio, &p_filter->fmt_out.audio ) )
+    if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 )
     {
-        msg_Warn( p_filter, "input and output formats are not similar" );
+        msg_Warn( p_filter, "bad input format" );
         return VLC_EGENERIC;
     }
 
-    p_filter->pf_audio_filter = DoWork;
-
     /* Allocate structure */
     p_sys = p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
 
@@ -167,7 +158,7 @@ static int Open( vlc_object_t *p_this )
     vlc_cond_init( &p_thread->wait );
 
     p_thread->i_blocks = 0;
-    date_Init( &p_thread->date, p_filter->fmt_out.audio.i_rate, 1 );
+    date_Init( &p_thread->date, p_filter->fmt_in.audio.i_rate, 1 );
     date_Set( &p_thread->date, 0 );
     p_thread->i_channels = aout_FormatNbChannels( &p_filter->fmt_in.audio );
 
@@ -183,6 +174,8 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
+    p_filter->fmt_out.audio = p_filter->fmt_in.audio;
+    p_filter->pf_audio_filter = DoWork;
     return VLC_SUCCESS;
 }
 
index 048e159..ff7e7d5 100644 (file)
@@ -160,20 +160,12 @@ static int Open( vlc_object_t * p_this )
     filter_sys_t *p_sys;
 
     /* Test the audio format */
-    if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 ||
-        p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )
+    if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 )
     {
-        msg_Warn( p_filter, "bad input or output format" );
-        return VLC_EGENERIC;
-    }
-    if( !AOUT_FMTS_SIMILAR( &p_filter->fmt_in.audio, &p_filter->fmt_out.audio ) )
-    {
-        msg_Warn( p_filter, "input and outut are not similar" );
+        msg_Warn( p_filter, "bad input format" );
         return VLC_EGENERIC;
     }
 
-    p_filter->pf_audio_filter = DoWork;
-
     p_sys = p_filter->p_sys = (filter_sys_t*)malloc( sizeof( *p_sys ) );
     if( !p_sys )
         return VLC_ENOMEM;
@@ -201,6 +193,8 @@ static int Open( vlc_object_t * p_this )
         goto error;
     }
 
+    p_filter->fmt_out.audio = p_filter->fmt_in.audio;
+    p_filter->pf_audio_filter = DoWork;
     return VLC_SUCCESS;
 
 error:
index 752a317..fc2a150 100644 (file)
@@ -113,15 +113,9 @@ static int Open( vlc_object_t * p_this )
     filter_sys_t *p_sys;
 
     /* Test the audio format */
-    if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 ||
-        p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )
+    if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 )
     {
-        msg_Warn( p_filter, "bad input or output format" );
-        return VLC_EGENERIC;
-    }
-    if( !AOUT_FMTS_SIMILAR( &p_filter->fmt_in.audio, &p_filter->fmt_out.audio ) )
-    {
-        msg_Warn( p_filter, "input and outut are not similar" );
+        msg_Warn( p_filter, "bad input format" );
         return VLC_EGENERIC;
     }
 
@@ -155,6 +149,7 @@ static int Open( vlc_object_t * p_this )
         goto error;
     }
 
+    p_filter->fmt_out.audio = p_filter->fmt_in.audio;
     p_filter->pf_audio_filter = DoWork;
 
     return VLC_SUCCESS;