Zebediah Figura : winegstreamer: Read into an existing buffer if requested.
Alexandre Julliard
julliard at winehq.org
Wed Mar 11 17:38:31 CDT 2020
Module: wine
Branch: master
Commit: d61504f16b2751d754ea562f8d49fa86330cda43
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d61504f16b2751d754ea562f8d49fa86330cda43
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Tue Mar 10 15:06:20 2020 -0500
winegstreamer: Read into an existing buffer if requested.
oggdemux needs this.
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winegstreamer/gstdemux.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index a51354b13c..e9548e80e4 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -896,9 +896,8 @@ static GstFlowReturn request_buffer_src(GstPad *pad, GstObject *parent, guint64
HRESULT hr;
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)
ofs = This->nextpullofs;
if (ofs >= This->filesize) {
@@ -909,7 +908,8 @@ static GstFlowReturn request_buffer_src(GstPad *pad, GstObject *parent, guint64
len = This->filesize - ofs;
This->nextpullofs = ofs + len;
- *buf = gst_buffer_new_and_alloc(len);
+ if (!*buf)
+ *buf = gst_buffer_new_and_alloc(len);
gst_buffer_map(*buf, &info, GST_MAP_WRITE);
hr = IAsyncReader_SyncRead(This->reader, ofs, len, info.data);
gst_buffer_unmap(*buf, &info);
More information about the wine-cvs
mailing list