From edebb4ed92c8809132cd0ccd73baf669ca5560ce Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 9 Sep 2011 14:15:21 -0300 Subject: [PATCH] codecparsers: h264: Implement the nal_parser_free function --- gst-libs/gst/codecparsers/gsth264parser.c | 14 ++++++++++++++ tests/check/libs/h264parser.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c index e9986178ca..29c40f5c8d 100644 --- a/gst-libs/gst/codecparsers/gsth264parser.c +++ b/gst-libs/gst/codecparsers/gsth264parser.c @@ -1134,6 +1134,20 @@ gst_h264_nal_parser_new (void) return nalparser; } +/** + * gst_h264_nal_parser_free: + * @nalparser the #GstH264NalParser to free + * + * Frees @nalparser and sets it to %NULL + */ +void +gst_h264_nal_parser_free (GstH264NalParser * nalparser) +{ + g_slice_free (GstH264NalParser, nalparser); + + nalparser = NULL; +} + /** * gst_h264_parser_identify_nalu: * @nalparser: a #GstH264NalParser diff --git a/tests/check/libs/h264parser.c b/tests/check/libs/h264parser.c index 6d75917f5d..5d87980f9a 100644 --- a/tests/check/libs/h264parser.c +++ b/tests/check/libs/h264parser.c @@ -145,7 +145,7 @@ GST_START_TEST (test_h264_parse_slice_dpa) assert_equals_int (res, GST_H264_PARSER_OK); assert_equals_int (nalu.type, GST_H264_NAL_SLICE_DPA); - g_slice_free (GstH264NalParser, parser); + gst_h264_nal_parser_free (parser); } GST_END_TEST;