From 78ed46cc4f84760f501cc63b9068087d70dfe327 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 3 Feb 2012 16:12:24 +0100 Subject: [PATCH] cmmlenc: fix caps handling --- ext/annodex/gstcmmlenc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ext/annodex/gstcmmlenc.c b/ext/annodex/gstcmmlenc.c index 830ee183e1..d4b0ad1f14 100644 --- a/ext/annodex/gstcmmlenc.c +++ b/ext/annodex/gstcmmlenc.c @@ -442,9 +442,11 @@ gst_cmml_enc_parse_tag_head (GstCmmlEnc * enc, GstCmmlTagHead * head) goto alloc_error; headers = g_list_append (headers, head_buf); - caps = gst_pad_get_current_caps (enc->srcpad); + caps = gst_pad_query_caps (enc->srcpad, NULL); caps = gst_cmml_enc_set_header_on_caps (enc, caps, ident_buf, preamble_buf, head_buf); + gst_pad_set_caps (enc->srcpad, caps); + gst_caps_unref (caps); while (headers) { buffer = GST_BUFFER (headers->data); @@ -458,8 +460,6 @@ gst_cmml_enc_parse_tag_head (GstCmmlEnc * enc, GstCmmlTagHead * head) goto push_error; } - gst_caps_unref (caps); - enc->sent_headers = TRUE; return; @@ -469,7 +469,6 @@ flow_unexpected: enc->flow_return = GST_FLOW_ERROR; return; push_error: - gst_caps_unref (caps); /* fallthrough */ alloc_error: for (walk = headers; walk; walk = walk->next)