GNOME Bugzilla – Bug 369627
[mpeg2dec] unit test addition and memleak fix
Last modified: 2006-11-15 11:42:37 UTC
Hi, the first patch adds a minimal unit test for mpeg2dec. The one test tries to decode a correct stream. The second patch fixes a memleak in gstmpeg2dec which showed up by running the above unit test in valgrind. It might be sane to add the mpeg2dec unit test to VALGRIND_TESTS_DISABLE because libmpeg2 might be not valgrind clean on some archs with some optimizations. At least on PPC/altivec it crashes with valgrind (but runs fine without), might be a valgrind/altivec bug. Bye
Created attachment 75886 [details] [review] gstmpeg2dec-tests.diff
Created attachment 75887 [details] [review] mpeg2dec.diff
Created attachment 75889 [details] [review] gstmpeg2dec-tests.diff and add two other checks... one decoding a odd-sized video (which involves buffer copying and cropping) and one trying to decode some garbage.
Cool, thanks for the patch, committed: 2006-11-15 Tim-Philipp Müller <tim at centricular dot net> Patch by: Sebastian Dröge <slomo@circular-chaos.org> * ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_init): Fix memleak when creating pads from static pad templates (#369627). * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/mpeg2dec.c: (setup_mpeg2dec), (cleanup_mpeg2dec), (GST_START_TEST), (mpeg2dec_suite), (main): Add unit tests for mpeg2dec (#369627).