Zebediah Figura : winegstreamer: Store the wg_parser_stream pointers also in struct wg_parser.
Alexandre Julliard
julliard at winehq.org
Fri Feb 5 16:50:48 CST 2021
Module: wine
Branch: master
Commit: a03f7350b309ca7025783be1d2478c305d20dbf7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=a03f7350b309ca7025783be1d2478c305d20dbf7
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Thu Feb 4 20:53:38 2021 -0600
winegstreamer: Store the wg_parser_stream pointers also in struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winegstreamer/gstdemux.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 31f0a07d93f..d9cc072a8c7 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -48,6 +48,9 @@ static const GUID MEDIASUBTYPE_CVID = {mmioFOURCC('c','v','i','d'), 0x0000, 0x00
struct wg_parser
{
+ struct wg_parser_stream **streams;
+ unsigned int stream_count;
+
GstElement *container;
GstBus *bus;
GstPad *my_src, *their_sink;
@@ -2505,14 +2508,20 @@ static const struct strmbase_source_ops source_ops =
static struct parser_source *create_pin(struct parser *filter, const WCHAR *name)
{
- struct parser_source *pin, **new_array;
+ struct wg_parser *parser = filter->wg_parser;
struct wg_parser_stream *stream;
+ struct parser_source *pin;
char pad_name[19];
+ void *new_array;
- if (!(new_array = heap_realloc(filter->sources, (filter->source_count + 1) * sizeof(*new_array))))
+ if (!(new_array = heap_realloc(filter->sources, (filter->source_count + 1) * sizeof(*filter->sources))))
return NULL;
filter->sources = new_array;
+ if (!(new_array = realloc(parser->streams, (parser->stream_count + 1) * sizeof(*parser->streams))))
+ return NULL;
+ parser->streams = new_array;
+
if (!(pin = heap_alloc_zero(sizeof(*pin))))
return NULL;
@@ -2544,6 +2553,7 @@ static struct parser_source *create_pin(struct parser *filter, const WCHAR *name
gst_pad_set_query_function(stream->my_sink, query_sink_wrapper);
filter->sources[filter->source_count++] = pin;
+ parser->streams[parser->stream_count++] = stream;
return pin;
}
@@ -2589,6 +2599,9 @@ static HRESULT GST_RemoveOutputPins(struct parser *This)
This->source_count = 0;
heap_free(This->sources);
This->sources = NULL;
+ parser->stream_count = 0;
+ free(parser->streams);
+ parser->streams = NULL;
gst_element_set_bus(parser->container, NULL);
gst_object_unref(parser->container);
parser->container = NULL;
More information about the wine-cvs
mailing list