Commit 04fa6391 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Use IWMSyncReader2_SetAllocateForStream in the async reader.

parent 957ac08c
......@@ -151,7 +151,6 @@ struct wm_stream
WMT_STREAM_SELECTION selection;
WORD index;
bool eos;
bool allocate_stream;
/* Note that we only pretend to read compressed samples, and instead output
* uncompressed samples regardless of whether we are configured to read
* compressed samples. Rather, the behaviour of the reader objects differs
......@@ -193,6 +192,5 @@ struct wm_reader *wm_reader_from_sync_reader_inner(IUnknown *inner);
HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackAdvanced *callback_advanced, WORD stream_number,
INSSBuffer **ret_sample, QWORD *pts, QWORD *duration, DWORD *flags, WORD *ret_stream_number);
HRESULT wm_reader_set_allocate_for_stream(struct wm_reader *reader, WORD stream_number, BOOL allocate);
#endif /* __GST_PRIVATE_INCLUDED__ */
......@@ -896,14 +896,13 @@ static HRESULT WINAPI WMReaderAdvanced_GetAllocateForOutput(IWMReaderAdvanced6 *
return hr;
}
static HRESULT WINAPI WMReaderAdvanced_SetAllocateForStream(IWMReaderAdvanced6 *iface,
WORD stream_number, BOOL allocate)
static HRESULT WINAPI WMReaderAdvanced_SetAllocateForStream(IWMReaderAdvanced6 *iface, WORD stream_number, BOOL allocate)
{
struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
TRACE("reader %p, stream_number %u, allocate %d.\n", reader, stream_number, allocate);
return wm_reader_set_allocate_for_stream(reader->wm_reader, stream_number, allocate);
return IWMSyncReader2_SetAllocateForStream(reader->reader, stream_number, allocate ? reader->allocator : NULL);
}
static HRESULT WINAPI WMReaderAdvanced_GetAllocateForStream(IWMReaderAdvanced6 *iface, WORD output_num, BOOL *allocate)
......
......@@ -1628,9 +1628,6 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA
else if (stream->read_compressed && stream->stream_allocator)
hr = IWMReaderAllocatorEx_AllocateForStreamEx(stream->stream_allocator, stream->index + 1,
wg_buffer.size, &sample, 0, 0, 0, NULL);
else if (callback_advanced && stream->read_compressed && stream->allocate_stream)
hr = IWMReaderCallbackAdvanced_AllocateForStream(callback_advanced,
stream->index + 1, wg_buffer.size, &sample, NULL);
/* FIXME: Should these be pooled? */
else if (!(object = calloc(1, offsetof(struct buffer, data[wg_buffer.size]))))
hr = E_OUTOFMEMORY;
......@@ -1689,24 +1686,6 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA
}
}
HRESULT wm_reader_set_allocate_for_stream(struct wm_reader *reader, WORD stream_number, BOOL allocate)
{
struct wm_stream *stream;
EnterCriticalSection(&reader->cs);
if (!(stream = wm_reader_get_stream_by_stream_number(reader, stream_number)))
{
LeaveCriticalSection(&reader->cs);
return E_INVALIDARG;
}
stream->allocate_stream = !!allocate;
LeaveCriticalSection(&reader->cs);
return S_OK;
}
static struct wm_reader *impl_from_IUnknown(IUnknown *iface)
{
return CONTAINING_RECORD(iface, struct wm_reader, IUnknown_inner);
......
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