diff --git a/gst/videoparsers/gsth263parse.c b/gst/videoparsers/gsth263parse.c index b727f6212e..e6e94acf1a 100644 --- a/gst/videoparsers/gsth263parse.c +++ b/gst/videoparsers/gsth263parse.c @@ -179,7 +179,8 @@ out: } static void -gst_h263_parse_set_src_caps (GstH263Parse * h263parse, H263Params * params) +gst_h263_parse_set_src_caps (GstH263Parse * h263parse, + const H263Params * params) { GstStructure *st; GstCaps *caps, *sink_caps; @@ -283,7 +284,7 @@ gst_h263_parse_check_valid_frame (GstBaseParse * parse, /* If this is the first frame, parse and set srcpad caps */ if (h263parse->state == PARSING) { - H263Params *params = NULL; + H263Params params = { 0, }; GstFlowReturn res; res = gst_h263_parse_get_params (¶ms, buffer, FALSE, &h263parse->state); @@ -293,11 +294,8 @@ gst_h263_parse_check_valid_frame (GstBaseParse * parse, GST_BASE_PARSE_FORMAT_PASSTHROUGH, TRUE); } else { /* Set srcpad caps since we now have sufficient information to do so */ - gst_h263_parse_set_src_caps (h263parse, params); + gst_h263_parse_set_src_caps (h263parse, ¶ms); } - - if (params) - g_free (params); } *skipsize = psc_pos; @@ -325,7 +323,7 @@ gst_h263_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame) GstH263Parse *h263parse; GstBuffer *buffer; GstFlowReturn res; - H263Params *params = NULL; + H263Params params = { 0, }; h263parse = GST_H263_PARSE (parse); buffer = frame->buffer; @@ -348,12 +346,12 @@ gst_h263_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame) gst_buffer_set_caps (buffer, GST_PAD_CAPS (GST_BASE_PARSE_SRC_PAD (GST_BASE_PARSE (h263parse)))); - if (gst_h263_parse_is_delta_unit (params)) + if (gst_h263_parse_is_delta_unit (¶ms)) GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DELTA_UNIT); else GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT); out: - g_free (params); + return res; } diff --git a/gst/videoparsers/h263parse.c b/gst/videoparsers/h263parse.c index 993890b65f..b22c4de194 100644 --- a/gst/videoparsers/h263parse.c +++ b/gst/videoparsers/h263parse.c @@ -40,7 +40,7 @@ gst_h263_parse_is_delta_unit (const H263Params * params) * extract a subset of the data (for now, it quits once we have the picture * type. */ GstFlowReturn -gst_h263_parse_get_params (H263Params ** params_p, GstBuffer * buffer, +gst_h263_parse_get_params (H263Params * params, GstBuffer * buffer, gboolean fast, H263ParseState * state) { static const guint8 partable[6][2] = { @@ -72,16 +72,12 @@ gst_h263_parse_get_params (H263Params ** params_p, GstBuffer * buffer, "Extended PType" }; - H263Params *params; GstBitReader br; guint8 tr; guint32 psc, temp32; guint8 temp8, pquant; gboolean hasplusptype; - *params_p = g_new0 (H263Params, 1); - params = *params_p; - /* FIXME: we can optimise a little by checking the value of available * instead of calling using the bit reader's get_bits_* functions. */ gst_bit_reader_init_from_buffer (&br, buffer); diff --git a/gst/videoparsers/h263parse.h b/gst/videoparsers/h263parse.h index 344ad3a995..80eb919ae6 100644 --- a/gst/videoparsers/h263parse.h +++ b/gst/videoparsers/h263parse.h @@ -133,7 +133,7 @@ struct _H263Params gboolean gst_h263_parse_is_delta_unit (const H263Params * params); -GstFlowReturn gst_h263_parse_get_params (H263Params ** params_p, +GstFlowReturn gst_h263_parse_get_params (H263Params * params_p, GstBuffer * buffer, gboolean fast, H263ParseState * state);