Zebediah Figura : winegstreamer: Move the EOS handling from read_buffer() to the Unix library.
Alexandre Julliard
julliard at winehq.org
Thu Feb 18 16:06:05 CST 2021
Module: wine
Branch: master
Commit: 491945ee419542587a6990435849d12d7aa7306c
URL: https://source.winehq.org/git/wine.git/?a=commit;h=491945ee419542587a6990435849d12d7aa7306c
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Wed Feb 17 17:30:33 2021 -0600
winegstreamer: Move the EOS handling from read_buffer() to the Unix library.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winegstreamer/gstdemux.c | 8 --------
dlls/winegstreamer/wg_parser.c | 4 ++++
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index a4164ab643b..53977ed52c4 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -794,14 +794,6 @@ static GstFlowReturn read_buffer(struct parser *This, guint64 ofs, guint len, Gs
TRACE("filter %p, offset %s, length %u, buffer %p.\n", This, wine_dbgstr_longlong(ofs), len, buffer);
- if (ofs >= This->file_size)
- {
- WARN("Reading past eof: %s, %u\n", wine_dbgstr_longlong(ofs), len);
- return GST_FLOW_EOS;
- }
- if (len + ofs > This->file_size)
- len = This->file_size - ofs;
-
gst_buffer_map(buffer, &info, GST_MAP_WRITE);
hr = IAsyncReader_SyncRead(This->reader, ofs, len, info.data);
gst_buffer_unmap(buffer, &info);
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index f2f878ffabc..9fb3c4383fc 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -992,6 +992,10 @@ static GstFlowReturn request_buffer_src(GstPad *pad, GstObject *parent, guint64
if (offset == GST_BUFFER_OFFSET_NONE)
offset = parser->next_pull_offset;
parser->next_pull_offset = offset + size;
+ if (offset >= parser->file_size)
+ return GST_FLOW_EOS;
+ if (offset + size >= parser->file_size)
+ size = parser->file_size - offset;
if (!*buffer)
*buffer = new_buffer = gst_buffer_new_and_alloc(size);
More information about the wine-cvs
mailing list