[vlc-commits] visualization: fix output formats
Rémi Denis-Courmont
git at videolan.org
Wed Dec 19 20:09:49 CET 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 19 21:09:02 2012 +0200| [e9d2eb5c3d884117ac66c401f05ba941c755ea5e] | committer: Rémi Denis-Courmont
visualization: fix output formats
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e9d2eb5c3d884117ac66c401f05ba941c755ea5e
---
modules/visualization/goom.c | 17 +++++------------
modules/visualization/projectm.cpp | 14 ++++----------
modules/visualization/vsxu.cpp | 11 +++--------
3 files changed, 12 insertions(+), 30 deletions(-)
diff --git a/modules/visualization/goom.c b/modules/visualization/goom.c
index 175c048..aab6c58 100644
--- a/modules/visualization/goom.c
+++ b/modules/visualization/goom.c
@@ -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;
}
diff --git a/modules/visualization/projectm.cpp b/modules/visualization/projectm.cpp
index 048e159..ff7e7d5 100644
--- a/modules/visualization/projectm.cpp
+++ b/modules/visualization/projectm.cpp
@@ -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:
diff --git a/modules/visualization/vsxu.cpp b/modules/visualization/vsxu.cpp
index 752a317..fc2a150 100644
--- a/modules/visualization/vsxu.cpp
+++ b/modules/visualization/vsxu.cpp
@@ -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;
More information about the vlc-commits
mailing list