From: Alex Henrie alexhenrie24@gmail.com
--- dlls/quartz/acmwrapper.c | 6 +++--- dlls/quartz/avidec.c | 2 +- dlls/quartz/dsoundrender.c | 10 +++++----- dlls/quartz/filtergraph.c | 12 ++++++------ dlls/quartz/memallocator.c | 8 ++++---- dlls/quartz/quartz_private.h | 21 --------------------- dlls/quartz/systemclock.c | 6 +++--- 7 files changed, 22 insertions(+), 43 deletions(-)
diff --git a/dlls/quartz/acmwrapper.c b/dlls/quartz/acmwrapper.c index 8e1b5e6b773..424a4b1cafa 100644 --- a/dlls/quartz/acmwrapper.c +++ b/dlls/quartz/acmwrapper.c @@ -202,7 +202,7 @@ static HRESULT WINAPI acm_wrapper_sink_Receive(struct strmbase_sink *iface, IMed goto error; }
- TRACE("Sample start time: %s.\n", debugstr_time(tStart)); + TRACE("Sample start time: %s.\n", debugstr_reftime(tStart)); if (ash.cbSrcLengthUsed == cbSrcStream) { IMediaSample_SetTime(pOutSample, &tStart, &tStop); @@ -235,7 +235,7 @@ static HRESULT WINAPI acm_wrapper_sink_Receive(struct strmbase_sink *iface, IMed IMediaSample_SetMediaTime(pOutSample, NULL, NULL); }
- TRACE("Sample stop time: %s\n", debugstr_time(tStart)); + TRACE("Sample stop time: %s\n", debugstr_reftime(tStart));
hr = IMemInputPin_Receive(This->source.pMemInputPin, pOutSample); if (hr != S_OK && hr != VFW_E_NOT_CONNECTED) { @@ -417,7 +417,7 @@ static HRESULT WINAPI acm_wrapper_source_qc_Notify(IQualityControl *iface, HRESULT hr = S_OK;
TRACE("filter %p, sender %p, type %#x, proportion %ld, late %s, timestamp %s.\n", - filter, sender, q.Type, q.Proportion, debugstr_time(q.Late), debugstr_time(q.TimeStamp)); + filter, sender, q.Type, q.Proportion, debugstr_reftime(q.Late), debugstr_reftime(q.TimeStamp));
if (filter->source_qc_sink) return IQualityControl_Notify(filter->source_qc_sink, &filter->filter.IBaseFilter_iface, q); diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c index 8cc729748c1..9b0e8392c39 100644 --- a/dlls/quartz/avidec.c +++ b/dlls/quartz/avidec.c @@ -480,7 +480,7 @@ static HRESULT WINAPI avi_decompressor_source_qc_Notify(IQualityControl *iface, struct avi_decompressor *filter = impl_from_source_IQualityControl(iface);
TRACE("filter %p, sender %p, type %#x, proportion %ld, late %s, timestamp %s.\n", - filter, sender, q.Type, q.Proportion, debugstr_time(q.Late), debugstr_time(q.TimeStamp)); + filter, sender, q.Type, q.Proportion, debugstr_reftime(q.Late), debugstr_reftime(q.TimeStamp));
EnterCriticalSection(&filter->filter.stream_cs); if (q.Late > 0) diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 10eed43422e..84d48f51b5b 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -182,7 +182,7 @@ static HRESULT DSoundRender_GetWritePos(struct dsound_render *This, *ret_writepos = writepos; } else if (delta_t < 0) { REFERENCE_TIME past, min_writepos_t; - WARN("Delta too big %s/%s, overwriting old data or even skipping\n", debugstr_time(delta_t), debugstr_time(max_lag)); + WARN("Delta too big %s/%s, overwriting old data or even skipping\n", debugstr_reftime(delta_t), debugstr_reftime(max_lag)); if (min_writepos >= playpos) min_writepos_t = cur + time_from_pos(This, min_writepos - playpos); else @@ -200,7 +200,7 @@ static HRESULT DSoundRender_GetWritePos(struct dsound_render *This, } } else /* delta_t > 0 */ { DWORD aheadbytes; - WARN("Delta too big %s/%s, too far ahead\n", debugstr_time(delta_t), debugstr_time(max_lag)); + WARN("Delta too big %s/%s, too far ahead\n", debugstr_reftime(delta_t), debugstr_reftime(max_lag)); aheadbytes = pos_from_time(This, delta_t); WARN("Advancing %lu bytes.\n", aheadbytes); if (delta_t >= DSoundRenderer_Max_Fill) @@ -213,8 +213,8 @@ end: else *pfree = This->buf_size + playpos - *ret_writepos; if (time_from_pos(This, This->buf_size - *pfree) >= DSoundRenderer_Max_Fill) { - TRACE("Blocked: too full %s / %s\n", debugstr_time(time_from_pos(This, This->buf_size - *pfree)), - debugstr_time(DSoundRenderer_Max_Fill)); + TRACE("Blocked: too full %s / %s\n", debugstr_reftime(time_from_pos(This, This->buf_size - *pfree)), + debugstr_reftime(DSoundRenderer_Max_Fill)); return S_FALSE; } return S_OK; @@ -964,7 +964,7 @@ static HRESULT WINAPI dsound_render_qc_Notify(IQualityControl *iface, struct dsound_render *filter = impl_from_IQualityControl(iface);
FIXME("filter %p, sender %p, type %#x, proportion %ld, late %s, timestamp %s, stub!\n", - filter, sender, q.Type, q.Proportion, debugstr_time(q.Late), debugstr_time(q.TimeStamp)); + filter, sender, q.Type, q.Proportion, debugstr_reftime(q.Late), debugstr_reftime(q.TimeStamp));
return E_NOTIMPL; } diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 4100e71be3a..f4e89d0ce7d 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -2315,7 +2315,7 @@ static HRESULT WINAPI MediaSeeking_GetDuration(IMediaSeeking *iface, LONGLONG *d LeaveCriticalSection(&graph->cs);
TRACE("Returning hr %#lx, duration %s (%s seconds).\n", hr, - wine_dbgstr_longlong(*duration), debugstr_time(*duration)); + wine_dbgstr_longlong(*duration), debugstr_reftime(*duration)); return hr; }
@@ -2356,7 +2356,7 @@ static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, LONGLON
LeaveCriticalSection(&graph->cs);
- TRACE("Returning %s (%s seconds).\n", wine_dbgstr_longlong(*stop), debugstr_time(*stop)); + TRACE("Returning %s (%s seconds).\n", wine_dbgstr_longlong(*stop), debugstr_reftime(*stop)); return hr; }
@@ -2386,7 +2386,7 @@ static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, LONG
LeaveCriticalSection(&graph->cs);
- TRACE("Returning %s (%s seconds).\n", wine_dbgstr_longlong(ret), debugstr_time(ret)); + TRACE("Returning %s (%s seconds).\n", wine_dbgstr_longlong(ret), debugstr_reftime(ret)); *current = ret;
return S_OK; @@ -2427,10 +2427,10 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG * stop_ptr ? wine_dbgstr_longlong(*stop_ptr): "<null>", stop_flags); if (current_ptr) TRACE("Setting current position to %s (%s seconds).\n", - wine_dbgstr_longlong(*current_ptr), debugstr_time(*current_ptr)); + wine_dbgstr_longlong(*current_ptr), debugstr_reftime(*current_ptr)); if (stop_ptr) TRACE("Setting stop position to %s (%s seconds).\n", - wine_dbgstr_longlong(*stop_ptr), debugstr_time(*stop_ptr)); + wine_dbgstr_longlong(*stop_ptr), debugstr_reftime(*stop_ptr));
if ((current_flags & 0x7) != AM_SEEKING_AbsolutePositioning && (current_flags & 0x7) != AM_SEEKING_NoPositioning) @@ -5159,7 +5159,7 @@ static HRESULT WINAPI MediaFilter_Run(IMediaFilter *iface, REFERENCE_TIME start) struct filter_graph *graph = impl_from_IMediaFilter(iface); HRESULT hr;
- TRACE("graph %p, start %s.\n", graph, debugstr_time(start)); + TRACE("graph %p, start %s.\n", graph, debugstr_reftime(start));
EnterCriticalSection(&graph->cs);
diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c index 87869b4d6b2..bd6e3ea936a 100644 --- a/dlls/quartz/memallocator.c +++ b/dlls/quartz/memallocator.c @@ -560,8 +560,8 @@ static HRESULT WINAPI StdMediaSample2_SetTime(IMediaSample2 *iface, REFERENCE_TI { StdMediaSample2 *sample = impl_from_IMediaSample2(iface);
- TRACE("sample %p, start %s, end %s.\n", sample, start ? debugstr_time(*start) : "(null)", - end ? debugstr_time(*end) : "(null)"); + TRACE("sample %p, start %s, end %s.\n", sample, start ? debugstr_reftime(*start) : "(null)", + end ? debugstr_reftime(*end) : "(null)");
if (start) { @@ -742,8 +742,8 @@ static HRESULT WINAPI StdMediaSample2_SetMediaTime(IMediaSample2 *iface, LONGLON { StdMediaSample2 *sample = impl_from_IMediaSample2(iface);
- TRACE("sample %p, start %s, end %s.\n", sample, start ? debugstr_time(*start) : "(null)", - end ? debugstr_time(*end) : "(null)"); + TRACE("sample %p, start %s, end %s.\n", sample, start ? debugstr_reftime(*start) : "(null)", + end ? debugstr_reftime(*end) : "(null)");
if (start) { diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index 849795d9c1b..af31afc1d74 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -44,27 +44,6 @@ 0, 0, { (DWORD_PTR)(__FILE__ ": " # cs) }}; \ static CRITICAL_SECTION cs = { &cs##_debug, -1, 0, 0, 0, 0 };
-static inline const char *debugstr_time(REFERENCE_TIME time) -{ - ULONGLONG abstime = time >= 0 ? time : -time; - unsigned int i = 0, j = 0; - char buffer[23], rev[23]; - - while (abstime || i <= 8) - { - buffer[i++] = '0' + (abstime % 10); - abstime /= 10; - if (i == 7) buffer[i++] = '.'; - } - if (time < 0) buffer[i++] = '-'; - - while (i--) rev[j++] = buffer[i]; - while (rev[j-1] == '0' && rev[j-2] != '.') --j; - rev[j] = 0; - - return wine_dbg_sprintf("%s", rev); -} - /* see IAsyncReader::Request on MSDN for the explanation of this */ #define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000) #define BYTES_FROM_MEDIATIME(time) ((time) / 10000000) diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c index 01a8e9fa1ee..51fcc99db75 100644 --- a/dlls/quartz/systemclock.c +++ b/dlls/quartz/systemclock.c @@ -255,7 +255,7 @@ static HRESULT WINAPI SystemClockImpl_GetTime(IReferenceClock *iface, REFERENCE_
LeaveCriticalSection(&clock->cs);
- TRACE("clock %p, time %p, returning %s.\n", clock, time, debugstr_time(ret)); + TRACE("clock %p, time %p, returning %s.\n", clock, time, debugstr_reftime(ret)); return hr; }
@@ -265,7 +265,7 @@ static HRESULT WINAPI SystemClockImpl_AdviseTime(IReferenceClock *iface, struct system_clock *clock = impl_from_IReferenceClock(iface);
TRACE("clock %p, base %s, offset %s, event %#Ix, cookie %p.\n", - clock, debugstr_time(base), debugstr_time(offset), event, cookie); + clock, debugstr_reftime(base), debugstr_reftime(offset), event, cookie);
if (base + offset <= 0) return E_INVALIDARG; @@ -279,7 +279,7 @@ static HRESULT WINAPI SystemClockImpl_AdvisePeriodic(IReferenceClock* iface, struct system_clock *clock = impl_from_IReferenceClock(iface);
TRACE("clock %p, start %s, period %s, semaphore %#Ix, cookie %p.\n", - clock, debugstr_time(start), debugstr_time(period), semaphore, cookie); + clock, debugstr_reftime(start), debugstr_reftime(period), semaphore, cookie);
if (start <= 0 || period <= 0) return E_INVALIDARG;