mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
souphttpsrc: Fix buffer handling
souphttpsrc is now usable again and doesn't crash anymore whenever something is read from a HTTP connection.
This commit is contained in:
parent
93e3ed5a86
commit
e3c8c4f8b0
1 changed files with 3 additions and 1 deletions
|
@ -933,6 +933,7 @@ gst_soup_http_src_got_chunk_cb (SoupMessage * msg, SoupBuffer * chunk,
|
||||||
{
|
{
|
||||||
GstBaseSrc *basesrc;
|
GstBaseSrc *basesrc;
|
||||||
guint64 new_position;
|
guint64 new_position;
|
||||||
|
SoupGstChunk *gchunk;
|
||||||
|
|
||||||
if (G_UNLIKELY (msg != src->msg)) {
|
if (G_UNLIKELY (msg != src->msg)) {
|
||||||
GST_DEBUG_OBJECT (src, "got chunk, but not for current message");
|
GST_DEBUG_OBJECT (src, "got chunk, but not for current message");
|
||||||
|
@ -948,7 +949,8 @@ gst_soup_http_src_got_chunk_cb (SoupMessage * msg, SoupBuffer * chunk,
|
||||||
chunk->length);
|
chunk->length);
|
||||||
|
|
||||||
/* Extract the GstBuffer from the SoupBuffer and set its fields. */
|
/* Extract the GstBuffer from the SoupBuffer and set its fields. */
|
||||||
*src->outbuf = GST_BUFFER_CAST (soup_buffer_get_owner (chunk));
|
gchunk = (SoupGstChunk *) soup_buffer_get_owner (chunk);
|
||||||
|
*src->outbuf = gchunk->buffer;
|
||||||
|
|
||||||
gst_buffer_resize (*src->outbuf, 0, chunk->length);
|
gst_buffer_resize (*src->outbuf, 0, chunk->length);
|
||||||
GST_BUFFER_OFFSET (*src->outbuf) = basesrc->segment.position;
|
GST_BUFFER_OFFSET (*src->outbuf) = basesrc->segment.position;
|
||||||
|
|
Loading…
Reference in a new issue