[FFmpeg-soc] [soc]: r4714 - in afilters: af_null.c dummy.c

kdub subversion at mplayerhq.hu
Tue Jul 14 10:09:58 CEST 2009


Author: kdub
Date: Tue Jul 14 10:09:58 2009
New Revision: 4714

Log:
memcpy the instance of the filter instead of having code duplication

Modified:
   afilters/af_null.c
   afilters/dummy.c

Modified: afilters/af_null.c
==============================================================================
--- afilters/af_null.c	Mon Jul 13 20:36:13 2009	(r4713)
+++ afilters/af_null.c	Tue Jul 14 10:09:58 2009	(r4714)
@@ -48,22 +48,6 @@ AVFilter avfilter_af_null =
                                   { .name = NULL}},
 };
 
-AVFilter avfilter_af_null2 =
-{
-    .name      = "audio_null",
-
-    .priv_size = sizeof(af_null_priv_t),
-
-    .inputs    = (AVFilterPad[]) {{ .name            = "default",
-                                    .type            = CODEC_TYPE_AUDIO,
-                                    .filter_buffer    = filter },
-                                  { .name = NULL}},
-
-    .outputs   = (AVFilterPad[]) {{ .name            = "default",
-                                    .type            = CODEC_TYPE_AUDIO, },
-                                  { .name = NULL}},
-};
-
 
 static int filter(AVFilterLink *link, AVFilterBufferRef *sample_ref)
 {

Modified: afilters/dummy.c
==============================================================================
--- afilters/dummy.c	Mon Jul 13 20:36:13 2009	(r4713)
+++ afilters/dummy.c	Tue Jul 14 10:09:58 2009	(r4714)
@@ -102,14 +102,15 @@ int main()
     /* set up the first filter */
     AVFilterContext * avfiltcont=NULL;
     AVFilter *avfilt;
-    avfilt = &avfilter_af_null;
+    avfilt = (AVFilter*)malloc(sizeof(AVFilter));
+    memcpy(avfilt, &avfilter_af_null, sizeof(AVFilter));
     avfiltcont = avfilter_open(avfilt, "filterID1234");
     avfilter_register(avfilt);
 
     /* set up the first filter */
     AVFilterContext * avfiltcont2=NULL;
     AVFilter *avfilt2;
-    avfilt2 = &avfilter_af_null2;
+    avfilt2 = (AVFilter*)malloc(sizeof(AVFilter));
     memcpy(avfilt2, &avfilter_af_null, sizeof(AVFilter));
     avfiltcont2 = avfilter_open(avfilt2, "filtery");
     avfilter_register(avfilt2);


More information about the FFmpeg-soc mailing list