[vlc-commits] filter: simplify filter owner usage
Rémi Denis-Courmont
git at videolan.org
Thu Aug 9 19:34:03 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Aug 9 20:22:23 2012 +0300| [5b95e7960b59c1be167aa4d12a6bd7b0504de28a] | committer: Rémi Denis-Courmont
filter: simplify filter owner usage
Also remove unchecked memory allocation.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5b95e7960b59c1be167aa4d12a6bd7b0504de28a
---
src/audio_output/aout_internal.h | 6 ------
src/audio_output/filters.c | 2 --
src/audio_output/input.c | 9 ++-------
3 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index abdec7d..70d15e3 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -42,12 +42,6 @@ typedef struct
void *p_private;
} aout_request_vout_t;
-struct filter_owner_sys_t
-{
- audio_output_t *p_aout;
- aout_input_t *p_input;
-};
-
typedef struct aout_volume aout_volume_t;
/** an input stream for the audio output */
diff --git a/src/audio_output/filters.c b/src/audio_output/filters.c
index 1112a87..b6a61bf 100644
--- a/src/audio_output/filters.c
+++ b/src/audio_output/filters.c
@@ -59,7 +59,6 @@ static filter_t * FindFilter( vlc_object_t *obj,
p_filter->fmt_in.i_codec = infmt->i_format;
p_filter->fmt_out.audio = *outfmt;
p_filter->fmt_out.i_codec = outfmt->i_format;
- p_filter->p_owner = NULL;
if( infmt->i_format == outfmt->i_format
&& infmt->i_physical_channels == outfmt->i_physical_channels
@@ -202,7 +201,6 @@ void aout_FiltersDestroyPipeline( filter_t *const *filters, unsigned n )
filter_t *p_filter = filters[i];
module_unneed( p_filter, p_filter->p_module );
- free( p_filter->p_owner );
vlc_object_release( p_filter );
}
}
diff --git a/src/audio_output/input.c b/src/audio_output/input.c
index c045856..1c36e64 100644
--- a/src/audio_output/input.c
+++ b/src/audio_output/input.c
@@ -147,10 +147,7 @@ aout_input_t *aout_InputNew (audio_output_t * p_aout,
psz_parser = psz_next;
continue;
}
-
- p_filter->p_owner = malloc( sizeof(*p_filter->p_owner) );
- p_filter->p_owner->p_aout = p_aout;
- p_filter->p_owner->p_input = p_input;
+ p_filter->p_owner = (filter_owner_sys_t *)p_input;
/* request format */
memcpy( &p_filter->fmt_in.audio, &chain_output_format,
@@ -205,7 +202,6 @@ aout_input_t *aout_InputNew (audio_output_t * p_aout,
msg_Err( p_aout, "cannot add user filter %s (skipped)",
psz_parser );
- free( p_filter->p_owner );
vlc_object_release( p_filter );
psz_parser = psz_next;
@@ -222,7 +218,6 @@ aout_input_t *aout_InputNew (audio_output_t * p_aout,
psz_parser );
module_unneed( p_filter, p_filter->p_module );
- free( p_filter->p_owner );
vlc_object_release( p_filter );
psz_parser = psz_next;
@@ -553,7 +548,7 @@ static vout_thread_t *RequestVout( void *p_private,
vout_thread_t *aout_filter_RequestVout( filter_t *p_filter,
vout_thread_t *p_vout, video_format_t *p_fmt )
{
- aout_input_t *p_input = p_filter->p_owner->p_input;
+ aout_input_t *p_input = (aout_input_t *)p_filter->p_owner;
aout_request_vout_t *p_request = &p_input->request_vout;
/* XXX: this only works from audio input */
More information about the vlc-commits
mailing list