Commit 59c55e96 authored by Derek Lesho's avatar Derek Lesho Committed by Alexandre Julliard

winegstreamer: Set MF_PD_DURATION on source's presentation descriptor.

parent e12b7d21
...@@ -1237,6 +1237,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ ...@@ -1237,6 +1237,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
struct media_source *object = heap_alloc_zero(sizeof(*object)); struct media_source *object = heap_alloc_zero(sizeof(*object));
IMFStreamDescriptor **descriptors = NULL; IMFStreamDescriptor **descriptors = NULL;
gint64 total_pres_time = 0;
DWORD bytestream_caps; DWORD bytestream_caps;
unsigned int i; unsigned int i;
HRESULT hr; HRESULT hr;
...@@ -1357,6 +1358,25 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ ...@@ -1357,6 +1358,25 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
heap_free(descriptors); heap_free(descriptors);
descriptors = NULL; descriptors = NULL;
for (i = 0; i < object->stream_count; i++)
{
gint64 stream_pres_time;
if (gst_pad_query_duration(object->streams[i]->their_src, GST_FORMAT_TIME, &stream_pres_time))
{
TRACE("Stream %u has duration %llu\n", i, (unsigned long long int) stream_pres_time);
if (stream_pres_time > total_pres_time)
total_pres_time = stream_pres_time;
}
else
{
WARN("Unable to get presentation time of stream %u\n", i);
}
}
if (object->stream_count)
IMFPresentationDescriptor_SetUINT64(object->pres_desc, &MF_PD_DURATION, total_pres_time / 100);
object->state = SOURCE_STOPPED; object->state = SOURCE_STOPPED;
*out_media_source = object; *out_media_source = object;
......
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