Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/mfreadwrite/reader.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index 2180ddedba..985a90e364 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -1003,11 +1003,26 @@ static void source_reader_release_responses(struct source_reader *reader, struct static void source_reader_flush_stream(struct source_reader *reader, DWORD stream_index) { struct media_stream *stream = stream_index == MF_SOURCE_READER_ALL_STREAMS ? NULL : &reader->streams[stream_index]; + unsigned int i;
source_reader_release_responses(reader, stream); - if (stream->decoder) - IMFTransform_ProcessMessage(stream->decoder, MFT_MESSAGE_COMMAND_FLUSH, 0); - stream->requests = 0; + if (stream) + { + if (stream->decoder) + IMFTransform_ProcessMessage(stream->decoder, MFT_MESSAGE_COMMAND_FLUSH, 0); + + stream->requests = 0; + } + else + { + for (i = 0; i < reader->stream_count; i++) + { + if (reader->streams[i].decoder) + IMFTransform_ProcessMessage(reader->streams[i].decoder, MFT_MESSAGE_COMMAND_FLUSH, 0); + + reader->streams[i].requests = 0; + } + } }
static HRESULT source_reader_flush(struct source_reader *reader, unsigned int index)
Thanks, I clearly messed up this one. It's better to have a loop in reader_flush() because it's the only place that needs to handle ALL flag.