From: Rémi Bernon rbernon@codeweavers.com
It is invalid according to GStreamer documentation.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winegstreamer/wg_parser.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 7d55897aa0a..ca95f187aea 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -167,8 +167,7 @@ static NTSTATUS wg_parser_push_data(void *args) /* Note that we don't allocate the buffer until we have a size. * midiparse passes a NULL buffer and a size of UINT_MAX, in an * apparent attempt to read the whole input stream at once. */ - if (!parser->read_request.buffer) - parser->read_request.buffer = gst_buffer_new_and_alloc(size); + parser->read_request.buffer = gst_buffer_new_and_alloc(size); gst_buffer_map(parser->read_request.buffer, &map_info, GST_MAP_WRITE); memcpy(map_info.data, data, size); gst_buffer_unmap(parser->read_request.buffer, &map_info); @@ -886,9 +885,7 @@ static GstFlowReturn src_getrange_cb(GstPad *pad, GstObject *parent, /* asfreader occasionally asks for zero bytes. gst_buffer_map() will * return NULL in this case. Avoid confusing the read thread by asking * it for zero bytes. */ - if (!*buffer) - *buffer = gst_buffer_new_and_alloc(0); - gst_buffer_set_size(*buffer, 0); + *buffer = gst_buffer_new_and_alloc(0); GST_LOG("Returning empty buffer."); return GST_FLOW_OK; } @@ -896,7 +893,7 @@ static GstFlowReturn src_getrange_cb(GstPad *pad, GstObject *parent, pthread_mutex_lock(&parser->mutex);
assert(!parser->read_request.size); - parser->read_request.buffer = *buffer; + parser->read_request.buffer = NULL; parser->read_request.offset = offset; parser->read_request.size = size; parser->read_request.done = false;