Commit 7144bf27 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard
parent d9062778
......@@ -6488,9 +6488,7 @@ static void test_wma_decoder(void)
ok(status == 0, "got status %#lx\n", status);
value = 0xdeadbeef;
hr = IMFSample_GetUINT32(sample, &MFSampleExtension_CleanPoint, &value);
todo_wine
ok(hr == S_OK, "GetUINT32 MFSampleExtension_CleanPoint returned %#lx\n", hr);
todo_wine
ok(value == 1, "got MFSampleExtension_CleanPoint %u\n", value);
hr = IMFSample_GetTotalLength(sample, &length);
ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr);
......
......@@ -904,6 +904,7 @@ HRESULT mf_create_wg_sample(IMFSample *sample, struct wg_sample **out)
DWORD current_length, max_length;
struct mf_sample *mf_sample;
LONGLONG time, duration;
UINT32 value;
BYTE *buffer;
HRESULT hr;
......@@ -924,6 +925,8 @@ HRESULT mf_create_wg_sample(IMFSample *sample, struct wg_sample **out)
mf_sample->wg_sample.flags |= WG_SAMPLE_FLAG_HAS_DURATION;
mf_sample->wg_sample.duration = duration;
}
if (SUCCEEDED(IMFSample_GetUINT32(sample, &MFSampleExtension_CleanPoint, &value)) && value)
mf_sample->wg_sample.flags |= WG_SAMPLE_FLAG_SYNC_POINT;
IMFSample_AddRef((mf_sample->sample = sample));
mf_sample->wg_sample.data = buffer;
......@@ -953,6 +956,8 @@ void mf_destroy_wg_sample(struct wg_sample *wg_sample)
IMFSample_SetSampleTime(mf_sample->sample, wg_sample->pts);
if (wg_sample->flags & WG_SAMPLE_FLAG_HAS_DURATION)
IMFSample_SetSampleDuration(mf_sample->sample, wg_sample->duration);
if (wg_sample->flags & WG_SAMPLE_FLAG_SYNC_POINT)
IMFSample_SetUINT32(mf_sample->sample, &MFSampleExtension_CleanPoint, 1);
IMFSample_Release(mf_sample->sample);
free(mf_sample);
......
......@@ -116,6 +116,7 @@ enum wg_sample_flag
WG_SAMPLE_FLAG_INCOMPLETE = 1,
WG_SAMPLE_FLAG_HAS_PTS = 2,
WG_SAMPLE_FLAG_HAS_DURATION = 4,
WG_SAMPLE_FLAG_SYNC_POINT = 8,
};
struct wg_sample
......
......@@ -369,6 +369,8 @@ NTSTATUS wg_transform_push_data(void *args)
GST_BUFFER_PTS(buffer) = sample->pts * 100;
if (sample->flags & WG_SAMPLE_FLAG_HAS_DURATION)
GST_BUFFER_DURATION(buffer) = sample->duration * 100;
if (!(sample->flags & WG_SAMPLE_FLAG_SYNC_POINT))
GST_BUFFER_FLAG_SET(buffer, GST_BUFFER_FLAG_DELTA_UNIT);
gst_buffer_list_insert(transform->input, -1, buffer);
GST_INFO("Copied %u bytes from sample %p to input buffer list", sample->size, sample);
......@@ -415,6 +417,8 @@ static NTSTATUS read_transform_output_data(GstBuffer *buffer, struct wg_sample *
sample->flags |= WG_SAMPLE_FLAG_HAS_DURATION;
sample->duration = duration;
}
if (!GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_DELTA_UNIT))
sample->flags |= WG_SAMPLE_FLAG_SYNC_POINT;
GST_INFO("Copied %u bytes, sample %p, flags %#x", sample->size, sample, sample->flags);
return STATUS_SUCCESS;
......
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