curlhttpsrc: set BUFFER_OFFSET when creating GstBuffer
authorAlex Ashley <bugzilla@ashley-family.net>
Tue, 5 Feb 2019 17:10:03 +0000 (17:10 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 19 Feb 2019 17:55:13 +0000 (17:55 +0000)
To make curlhttpsrc behave more like souphttpsrc, set the
BUFFER_OFFSET in its output buffers to match the segment
start. This means that in a HTTP RANGE request, the BUFFER_OFFSET
will match the value in the RANGE request.

ext/curl/gstcurlhttpsrc.c

index 3f151a7..274bfed 100644 (file)
@@ -979,6 +979,7 @@ retry:
         src->buffer_len, src->uri);
     *outbuf = gst_buffer_new_allocate (NULL, src->buffer_len, NULL);
     gst_buffer_fill (*outbuf, 0, src->buffer, src->buffer_len);
+    GST_BUFFER_OFFSET (*outbuf) = basesrc->segment.position;
 
     g_free (src->buffer);
     src->buffer = NULL;