[vlc-devel] commit: Avoid hackish use of psz_object_name ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun Aug 23 21:00:23 CEST 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Aug 23 21:59:24 2009 +0300| [6b15eba41eb55231031a8325248065a11793f7ef] | committer: Rémi Denis-Courmont
Avoid hackish use of psz_object_name
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6b15eba41eb55231031a8325248065a11793f7ef
---
src/audio_output/input.c | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/src/audio_output/input.c b/src/audio_output/input.c
index 9c69eee..b394eab 100644
--- a/src/audio_output/input.c
+++ b/src/audio_output/input.c
@@ -248,6 +248,8 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_
/* parse user filter lists */
char *const ppsz_array[] = { psz_scaletempo, psz_filters, psz_visual };
+ p_input->p_playback_rate_filter = NULL;
+
for( i_visual = 0; i_visual < 3 && !AOUT_FMT_NON_LINEAR(&chain_output_format); i_visual++ )
{
char *psz_next = NULL;
@@ -388,6 +390,9 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_
memcpy( &chain_input_format, &p_filter->output,
sizeof( audio_sample_format_t ) );
+ if( i_visual == 0 ) /* scaletempo */
+ p_input->p_playback_rate_filter = p_filter;
+
/* next filter if any */
psz_parser = psz_next;
}
@@ -443,19 +448,6 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_
}
p_input->i_resampling_type = AOUT_RESAMPLING_NONE;
- p_input->p_playback_rate_filter = NULL;
- for( int i = 0; i < p_input->i_nb_filters; i++ )
- {
- aout_filter_t *p_filter = p_input->pp_filters[i];
- /* FIXME: suspicious access to psz_object_name */
-#warning Is this right?
- if( strcmp( "scaletempo",
- vlc_internals(p_filter)->psz_object_name ) == 0 )
- {
- p_input->p_playback_rate_filter = p_filter;
- break;
- }
- }
if( ! p_input->p_playback_rate_filter && p_input->i_nb_resamplers > 0 )
{
p_input->p_playback_rate_filter = p_input->pp_resamplers[0];
More information about the vlc-devel
mailing list