mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 09:57:19 +00:00
mfreadwrite/tests: Avoid depending on sample size in test_source_reader().
At the same time, avoid depending on file length.
This commit is contained in:
parent
79387b2f9f
commit
b924671ea8
|
@ -782,14 +782,22 @@ static void test_source_reader(void)
|
|||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IMFMediaType_Release(mediatype);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
if (hr != S_OK)
|
||||
goto skip_read_sample;
|
||||
ok(!actual_index, "Unexpected stream index %lu.\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
IMFSample_Release(sample);
|
||||
for (;;)
|
||||
{
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected stream index %lu.\n", actual_index);
|
||||
ok(!(stream_flags & ~MF_SOURCE_READERF_ENDOFSTREAM), "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
|
||||
if (stream_flags & MF_SOURCE_READERF_ENDOFSTREAM)
|
||||
{
|
||||
ok(!sample, "Unexpected sample object.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
IMFSample_Release(sample);
|
||||
}
|
||||
|
||||
/* There is no video stream. */
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, &actual_index, &stream_flags,
|
||||
|
@ -805,28 +813,6 @@ static void test_source_reader(void)
|
|||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, NULL, NULL, ×tamp, &sample);
|
||||
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected stream index %lu.\n", actual_index);
|
||||
/* TODO: gstreamer outputs .wav sample in increments of 4096, instead of 4410 */
|
||||
todo_wine
|
||||
{
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(!sample, "Unexpected sample object.\n");
|
||||
}
|
||||
if(!stream_flags)
|
||||
{
|
||||
IMFSample_Release(sample);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected stream index %lu.\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(!sample, "Unexpected sample object.\n");
|
||||
}
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, MF_SOURCE_READER_CONTROLF_DRAIN,
|
||||
&actual_index, &stream_flags, ×tamp, &sample);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
@ -862,8 +848,6 @@ static void test_source_reader(void)
|
|||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(!sample, "Unexpected sample object.\n");
|
||||
|
||||
skip_read_sample:
|
||||
|
||||
/* Flush. */
|
||||
hr = IMFSourceReader_Flush(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
|
Loading…
Reference in a new issue