From: Brendan McGrath bmcgrath@codeweavers.com
The same behaviour occurs when duration is not provided. --- dlls/mf/tests/transform.c | 1 - dlls/winegstreamer/video_decoder.c | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 47be57d02fb..4153da28f37 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -5409,7 +5409,6 @@ static void test_h264_decoder_timestamps(void) ok(time == exp_zero_ts[i].time, "got time %I64d, expected %I64d\n", time, exp_zero_ts[i].time); hr = IMFSample_GetSampleDuration(output_sample, &duration); ok(hr == S_OK, "Got %#lx\n", hr); - todo_wine ok(duration == exp_zero_ts[i].duration, "got duration %I64d, expected %I64d\n", duration, exp_zero_ts[i].duration); ret = IMFSample_Release(output_sample); ok(ret == 0, "Release returned %lu\n", ret); diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index ba8b2d545f7..e56f7b9baf7 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -946,7 +946,7 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, { struct video_decoder *decoder = impl_from_IMFTransform(iface); UINT32 sample_size; - LONGLONG duration; + LONGLONG duration, sample_duration; IMFSample *sample; UINT64 frame_size, frame_rate; bool preserve_timestamps; @@ -1016,6 +1016,11 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, WARN("Failed to set sample duration\n"); decoder->sample_time += duration; } + else if (FAILED(IMFSample_GetSampleDuration(sample, &sample_duration)) || !sample_duration) + { + if (FAILED(IMFSample_SetSampleDuration(sample, duration))) + WARN("Failed to set sample duration\n"); + } }
if (hr == MF_E_TRANSFORM_STREAM_CHANGE)