From: Anton Baskanov baskanov@gmail.com
Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/quartz/tests/mpegaudio.c | 6 +++--- dlls/winegstreamer/quartz_transform.c | 28 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/dlls/quartz/tests/mpegaudio.c b/dlls/quartz/tests/mpegaudio.c index 5fdf443f3c8..75b85ee8716 100644 --- a/dlls/quartz/tests/mpegaudio.c +++ b/dlls/quartz/tests/mpegaudio.c @@ -888,11 +888,11 @@ static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample start = 0xdeadbeef; stop = 0xdeadbeef; hr = IMediaSample_GetTime(sample, &start, &stop); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(hr == S_OK, "Got hr %#lx.\n", hr); if (filter->got_sample == 1) { - todo_wine ok(start == filter->expected_start_time, "Got start time %s.\n", wine_dbgstr_longlong(start)); - todo_wine ok(stop == filter->expected_stop_time, "Got stop time %s.\n", wine_dbgstr_longlong(stop)); + ok(start == filter->expected_start_time, "Got start time %s.\n", wine_dbgstr_longlong(start)); + ok(stop == filter->expected_stop_time, "Got stop time %s.\n", wine_dbgstr_longlong(stop)); }
return S_OK; diff --git a/dlls/winegstreamer/quartz_transform.c b/dlls/winegstreamer/quartz_transform.c index 85fbcee8bcd..b556b49c771 100644 --- a/dlls/winegstreamer/quartz_transform.c +++ b/dlls/winegstreamer/quartz_transform.c @@ -281,6 +281,8 @@ static HRESULT WINAPI transform_sink_receive(struct strmbase_sink *pin, IMediaSa { struct transform *filter = impl_from_strmbase_filter(pin->pin.filter); struct wg_sample input_wg_sample = {0}; + REFERENCE_TIME start_time; + REFERENCE_TIME end_time; HRESULT hr;
/* We do not expect pin connection state to change while the filter is @@ -306,6 +308,18 @@ static HRESULT WINAPI transform_sink_receive(struct strmbase_sink *pin, IMediaSa if (FAILED(hr)) return hr;
+ hr = IMediaSample_GetTime(sample, &start_time, &end_time); + if (SUCCEEDED(hr)) + { + input_wg_sample.pts = start_time; + input_wg_sample.flags |= WG_SAMPLE_FLAG_HAS_PTS; + } + if (hr == S_OK) + { + input_wg_sample.duration = end_time - start_time; + input_wg_sample.flags |= WG_SAMPLE_FLAG_HAS_DURATION; + } + hr = wg_transform_push_data(filter->transform, &input_wg_sample); if (FAILED(hr)) return hr; @@ -347,6 +361,20 @@ static HRESULT WINAPI transform_sink_receive(struct strmbase_sink *pin, IMediaSa return hr; }
+ if (output_wg_sample.flags & WG_SAMPLE_FLAG_HAS_PTS) + { + start_time = output_wg_sample.pts; + if (output_wg_sample.flags & WG_SAMPLE_FLAG_HAS_DURATION) + { + end_time = start_time + output_wg_sample.duration; + IMediaSample_SetTime(output_sample, &start_time, &end_time); + } + else + { + IMediaSample_SetTime(output_sample, &start_time, NULL); + } + } + hr = IMemInputPin_Receive(filter->source.pMemInputPin, output_sample); if (FAILED(hr)) {