From b65da8e7753bcf7a4e227ab3504ea372a47c877c Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 17 Nov 2010 15:33:36 +0100 Subject: [PATCH] aacparse: minor cleanups --- gst/audioparsers/gstaacparse.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c index f5ecd4e..37e62a1 100644 --- a/gst/audioparsers/gstaacparse.c +++ b/gst/audioparsers/gstaacparse.c @@ -243,7 +243,6 @@ gst_aacparse_set_src_caps (GstAacParse * aacparse, GstCaps * sink_caps) GST_DEBUG_OBJECT (aacparse, "setting src caps: %" GST_PTR_FORMAT, src_caps); - gst_pad_use_fixed_caps (GST_BASE_PARSE (aacparse)->srcpad); res = gst_pad_set_caps (GST_BASE_PARSE (aacparse)->srcpad, src_caps); gst_caps_unref (src_caps); return res; @@ -265,6 +264,7 @@ gst_aacparse_sink_setcaps (GstBaseParse * parse, GstCaps * caps) GstAacParse *aacparse; GstStructure *structure; gchar *caps_str; + const GValue *value; aacparse = GST_AACPARSE (parse); structure = gst_caps_get_structure (caps, 0); @@ -276,12 +276,11 @@ gst_aacparse_sink_setcaps (GstBaseParse * parse, GstCaps * caps) /* This is needed at least in case of RTP * Parses the codec_data information to get ObjectType, * number of channels and samplerate */ - if (gst_structure_has_field (structure, "codec_data")) { + value = gst_structure_get_value (structure, "codec_data"); + if (value) { + GstBuffer *buf = gst_value_get_buffer (value); - const GValue *value = gst_structure_get_value (structure, "codec_data"); - - if (value) { - GstBuffer *buf = gst_value_get_buffer (value); + if (buf) { const guint8 *buffer = GST_BUFFER_DATA (buf); guint sr_idx; -- 2.7.4