From d065e7f104f7f23475dae7c1663ad20df2504527 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Fri, 18 Apr 2008 22:21:59 -0700 Subject: [PATCH] quartz: Optimize mpeg splitter and fix a time continuity bug --- dlls/quartz/mpegsplit.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/dlls/quartz/mpegsplit.c b/dlls/quartz/mpegsplit.c index 3c33075..6f8c502 100644 --- a/dlls/quartz/mpegsplit.c +++ b/dlls/quartz/mpegsplit.c @@ -53,7 +53,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); #define MPEG_AUDIO_HEADER 1 #define MPEG_NO_HEADER 0 -#define SEEK_INTERVAL (ULONGLONG)(30 * 10000000) /* Add an entry every 30 seconds */ +#define SEEK_INTERVAL (ULONGLONG)(10 * 10000000) /* Add an entry every 10 seconds */ struct seek_entry { ULONGLONG bytepos; @@ -215,6 +215,7 @@ static HRESULT FillBuffer(MPEGSplitterImpl *This, BYTE** fbuf, DWORD *flen, IMed if (This->remaining_bytes) { DWORD towrite = min(This->remaining_bytes, *flen); + LONGLONG foo; hr = copy_data(pCurrentSample, fbuf, flen, towrite); if (FAILED(hr)) @@ -227,6 +228,11 @@ static HRESULT FillBuffer(MPEGSplitterImpl *This, BYTE** fbuf, DWORD *flen, IMed if (This->remaining_bytes) return hr; + /* Restore the time in the time variable. This->position now points + * to the NEW timestamp which is slightly off + */ + IMediaSample_GetTime(pCurrentSample, &time, &foo); + /* Optimize: Try appending more samples to the stream */ goto out_append; } -- 1.5.4.1