kdub wrote : > 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/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)); > useless cast; and I would have written sizeof(*avfilt) > + memcpy(avfilt, &avfilter_af_null, sizeof(AVFilter)); > sizeof(*avfilt) > 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)); > same here > memcpy(avfilt2, &avfilter_af_null, sizeof(AVFilter)); > and here Ben _______________________________________________ FFmpeg-soc mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc
