Commit 28fe6207 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Keep default decodebin queue limits.

parent 1dc8cdae
......@@ -69,7 +69,7 @@ HRESULT wg_sample_queue_create(struct wg_sample_queue **out);
void wg_sample_queue_destroy(struct wg_sample_queue *queue);
void wg_sample_queue_flush(struct wg_sample_queue *queue, bool all);
wg_parser_t wg_parser_create(enum wg_parser_type type, bool unlimited_buffering);
wg_parser_t wg_parser_create(enum wg_parser_type type);
void wg_parser_destroy(wg_parser_t parser);
HRESULT wg_parser_connect(wg_parser_t parser, uint64_t file_size);
......
......@@ -66,17 +66,16 @@ bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
return TRUE;
}
wg_parser_t wg_parser_create(enum wg_parser_type type, bool unlimited_buffering)
wg_parser_t wg_parser_create(enum wg_parser_type type)
{
struct wg_parser_create_params params =
{
.type = type,
.unlimited_buffering = unlimited_buffering,
.err_on = ERR_ON(quartz),
.warn_on = WARN_ON(quartz),
};
TRACE("type %#x, unlimited_buffering %d.\n", type, unlimited_buffering);
TRACE("type %#x.\n", type);
if (WINE_UNIX_CALL(unix_wg_parser_create, &params))
return 0;
......
......@@ -1643,13 +1643,7 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc
if (FAILED(hr = MFAllocateWorkQueue(&object->async_commands_queue)))
goto fail;
/* In Media Foundation, sources may read from any media source stream
* without fear of blocking due to buffering limits on another. Trailmakers,
* a Unity3D Engine game, only reads one sample from the audio stream (and
* never deselects it). Remove buffering limits from decodebin in order to
* account for this. Note that this does leak memory, but the same memory
* leak occurs with native. */
if (!(parser = wg_parser_create(WG_PARSER_DECODEBIN, true)))
if (!(parser = wg_parser_create(WG_PARSER_DECODEBIN)))
{
hr = E_OUTOFMEMORY;
goto fail;
......
......@@ -1451,7 +1451,7 @@ static HRESULT parser_create(enum wg_parser_type type, struct parser **parser)
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (!(object->wg_parser = wg_parser_create(type, false)))
if (!(object->wg_parser = wg_parser_create(type)))
{
free(object);
return E_OUTOFMEMORY;
......
......@@ -212,7 +212,6 @@ struct wg_parser_create_params
{
wg_parser_t parser;
wg_parser_type type;
UINT8 unlimited_buffering;
UINT8 err_on;
UINT8 warn_on;
};
......
......@@ -93,8 +93,6 @@ struct wg_parser
bool sink_connected;
bool unlimited_buffering;
gchar *sink_caps;
struct input_cache_chunk input_cache_chunks[4];
......@@ -1771,13 +1769,6 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser)
gst_bin_add(GST_BIN(parser->container), element);
parser->decodebin = element;
if (parser->unlimited_buffering)
{
g_object_set(parser->decodebin, "max-size-buffers", G_MAXUINT, NULL);
g_object_set(parser->decodebin, "max-size-time", G_MAXUINT64, NULL);
g_object_set(parser->decodebin, "max-size-bytes", G_MAXUINT, NULL);
}
g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), parser);
g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser);
g_signal_connect(element, "autoplug-continue", G_CALLBACK(autoplug_continue_cb), parser);
......@@ -1888,7 +1879,6 @@ static NTSTATUS wg_parser_create(void *args)
pthread_cond_init(&parser->read_cond, NULL);
pthread_cond_init(&parser->read_done_cond, NULL);
parser->init_gst = init_funcs[params->type];
parser->unlimited_buffering = params->unlimited_buffering;
parser->err_on = params->err_on;
parser->warn_on = params->warn_on;
GST_DEBUG("Created winegstreamer parser %p.", parser);
......
......@@ -1459,7 +1459,7 @@ static HRESULT init_stream(struct wm_reader *reader, QWORD file_size)
HRESULT hr;
WORD i;
if (!(wg_parser = wg_parser_create(WG_PARSER_DECODEBIN, false)))
if (!(wg_parser = wg_parser_create(WG_PARSER_DECODEBIN)))
return E_OUTOFMEMORY;
reader->wg_parser = wg_parser;
......
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