Commit d61504f1 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Read into an existing buffer if requested.

oggdemux needs this. Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent c9f0d862
...@@ -896,9 +896,8 @@ static GstFlowReturn request_buffer_src(GstPad *pad, GstObject *parent, guint64 ...@@ -896,9 +896,8 @@ static GstFlowReturn request_buffer_src(GstPad *pad, GstObject *parent, guint64
HRESULT hr; HRESULT hr;
GstMapInfo info; GstMapInfo info;
TRACE("%p %s %i %p\n", pad, wine_dbgstr_longlong(ofs), len, buf); TRACE("pad %p, offset %s, length %u, buffer %p.\n", pad, wine_dbgstr_longlong(ofs), len, *buf);
*buf = NULL;
if (ofs == GST_BUFFER_OFFSET_NONE) if (ofs == GST_BUFFER_OFFSET_NONE)
ofs = This->nextpullofs; ofs = This->nextpullofs;
if (ofs >= This->filesize) { if (ofs >= This->filesize) {
...@@ -909,6 +908,7 @@ static GstFlowReturn request_buffer_src(GstPad *pad, GstObject *parent, guint64 ...@@ -909,6 +908,7 @@ static GstFlowReturn request_buffer_src(GstPad *pad, GstObject *parent, guint64
len = This->filesize - ofs; len = This->filesize - ofs;
This->nextpullofs = ofs + len; This->nextpullofs = ofs + len;
if (!*buf)
*buf = gst_buffer_new_and_alloc(len); *buf = gst_buffer_new_and_alloc(len);
gst_buffer_map(*buf, &info, GST_MAP_WRITE); gst_buffer_map(*buf, &info, GST_MAP_WRITE);
hr = IAsyncReader_SyncRead(This->reader, ofs, len, info.data); hr = IAsyncReader_SyncRead(This->reader, ofs, len, info.data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment