mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 04:00:37 +00:00
parent
cbbdfee98a
commit
289cd65abd
1 changed files with 11 additions and 6 deletions
|
@ -961,6 +961,7 @@ gst_flac_parse_handle_headers (GstFlacParse * flacparse)
|
||||||
GValue array = { 0, };
|
GValue array = { 0, };
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
gboolean res = TRUE;
|
||||||
|
|
||||||
caps = gst_caps_new_simple ("audio/x-flac",
|
caps = gst_caps_new_simple ("audio/x-flac",
|
||||||
"channels", G_TYPE_INT, flacparse->channels,
|
"channels", G_TYPE_INT, flacparse->channels,
|
||||||
|
@ -1040,23 +1041,27 @@ push_headers:
|
||||||
|
|
||||||
/* push header buffers; update caps, so when we push the first buffer the
|
/* push header buffers; update caps, so when we push the first buffer the
|
||||||
* negotiated caps will change to caps that include the streamheader field */
|
* negotiated caps will change to caps that include the streamheader field */
|
||||||
for (l = flacparse->headers; l != NULL; l = l->next) {
|
while (flacparse->headers) {
|
||||||
GstBuffer *buf = GST_BUFFER (l->data);
|
GstBuffer *buf = GST_BUFFER (flacparse->headers->data);
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret;
|
||||||
|
|
||||||
l->data = NULL;
|
flacparse->headers =
|
||||||
|
g_list_delete_link (flacparse->headers, flacparse->headers);
|
||||||
buf = gst_buffer_make_metadata_writable (buf);
|
buf = gst_buffer_make_metadata_writable (buf);
|
||||||
gst_buffer_set_caps (buf,
|
gst_buffer_set_caps (buf,
|
||||||
GST_PAD_CAPS (GST_BASE_PARSE_SRC_PAD (GST_BASE_PARSE (flacparse))));
|
GST_PAD_CAPS (GST_BASE_PARSE_SRC_PAD (GST_BASE_PARSE (flacparse))));
|
||||||
|
|
||||||
ret = gst_base_parse_push_buffer (GST_BASE_PARSE (flacparse), buf);
|
ret = gst_base_parse_push_buffer (GST_BASE_PARSE (flacparse), buf);
|
||||||
if (ret != GST_FLOW_OK)
|
if (ret != GST_FLOW_OK) {
|
||||||
return FALSE;
|
res = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
g_list_foreach (flacparse->headers, (GFunc) gst_mini_object_unref, NULL);
|
||||||
g_list_free (flacparse->headers);
|
g_list_free (flacparse->headers);
|
||||||
flacparse->headers = NULL;
|
flacparse->headers = NULL;
|
||||||
|
|
||||||
return TRUE;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue