Commit 1a7be756 authored by Giovanni Mascellani's avatar Giovanni Mascellani Committed by Alexandre Julliard

mfreadwrite: Unset seeking flag also on SourceStarted and SourceStopped.

parent ac0f240a
...@@ -550,9 +550,11 @@ static HRESULT source_reader_source_state_handler(struct source_reader *reader, ...@@ -550,9 +550,11 @@ static HRESULT source_reader_source_state_handler(struct source_reader *reader,
{ {
case MESourceStarted: case MESourceStarted:
reader->source_state = SOURCE_STATE_STARTED; reader->source_state = SOURCE_STATE_STARTED;
reader->flags &= ~SOURCE_READER_SEEKING;
break; break;
case MESourceStopped: case MESourceStopped:
reader->source_state = SOURCE_STATE_STOPPED; reader->source_state = SOURCE_STATE_STOPPED;
reader->flags &= ~SOURCE_READER_SEEKING;
break; break;
case MESourceSeeked: case MESourceSeeked:
reader->flags &= ~SOURCE_READER_SEEKING; reader->flags &= ~SOURCE_READER_SEEKING;
......
...@@ -902,6 +902,7 @@ static void test_source_reader_from_media_source(void) ...@@ -902,6 +902,7 @@ static void test_source_reader_from_media_source(void)
IMFAttributes *attributes; IMFAttributes *attributes;
ULONG refcount; ULONG refcount;
int i; int i;
PROPVARIANT pos;
source = create_test_source(); source = create_test_source();
ok(!!source, "Failed to create test source.\n"); ok(!!source, "Failed to create test source.\n");
...@@ -916,6 +917,11 @@ static void test_source_reader_from_media_source(void) ...@@ -916,6 +917,11 @@ static void test_source_reader_from_media_source(void)
hr = IMFSourceReader_SetStreamSelection(reader, 1, TRUE); hr = IMFSourceReader_SetStreamSelection(reader, 1, TRUE);
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr); ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
pos.vt = VT_I8;
pos.hVal.QuadPart = 0;
hr = IMFSourceReader_SetCurrentPosition(reader, &GUID_NULL, &pos);
ok(hr == S_OK, "Failed to seek to beginning of stream, hr %#x.\n", hr);
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_ANY_STREAM, 0, &actual_index, &stream_flags, hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_ANY_STREAM, 0, &actual_index, &stream_flags,
&timestamp, &sample); &timestamp, &sample);
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr); ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
......
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