From deff27e23ee9dca1791501c3ba31a0e6cf042c64 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Mon, 15 Jul 2013 13:04:42 -0500 Subject: [PATCH] wineqtdecoder: Calculate AvgTimePerFrame for video tracks. --- dlls/wineqtdecoder/qtsplitter.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 03cc8a9d1f0..9aa6314179d 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -884,6 +884,10 @@ static HRESULT QT_Process_Video_Track(QTSplitter* filter, Track trk) int t; DWORD outputWidth, outputHeight, outputDepth; Fixed trackWidth, trackHeight; + Media videoMedia; + long sampleCount; + TimeValue64 duration; + TimeScale timeScale; ZeroMemory(&amt, sizeof(amt)); amt.formattype = FORMAT_VideoInfo; @@ -952,6 +956,12 @@ static HRESULT QT_Process_Video_Track(QTSplitter* filter, Track trk) return E_FAIL; } + videoMedia = GetTrackMedia(trk); + sampleCount = GetMediaSampleCount(videoMedia); + timeScale = GetMediaTimeScale(videoMedia); + duration = GetMediaDisplayDuration(videoMedia); + pvi->AvgTimePerFrame = (100000.0 * sampleCount * timeScale) / duration; + piOutput.dir = PINDIR_OUTPUT; piOutput.pFilter = &filter->filter.IBaseFilter_iface; lstrcpyW(piOutput.achName,szwVideoOut);