From b98603e3e500bcf1b3621710bd34e42d73a96434 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Wed, 16 Apr 2008 14:24:16 -0700 Subject: [PATCH] quartz: Fix IMediaSample2 SetPreroll and SetSyncPoint ((This->props.dwSampleFlags & ~AM_SAMPLE_PREROLL) | bIsPreroll) was evaluated instead of only bIsSyncPoint, causing subtle breakage, replace it with more readable code instead --- dlls/quartz/memallocator.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c index 6b68cf5..b473b57 100644 --- a/dlls/quartz/memallocator.c +++ b/dlls/quartz/memallocator.c @@ -586,7 +586,10 @@ static HRESULT WINAPI StdMediaSample2_SetSyncPoint(IMediaSample2 * iface, BOOL b TRACE("(%s)\n", bIsSyncPoint ? "TRUE" : "FALSE"); - This->props.dwSampleFlags = (This->props.dwSampleFlags & ~AM_SAMPLE_SPLICEPOINT) | bIsSyncPoint ? AM_SAMPLE_SPLICEPOINT : 0; + if (bIsSyncPoint) + This->props.dwSampleFlags |= AM_SAMPLE_SPLICEPOINT; + else + This->props.dwSampleFlags &= ~AM_SAMPLE_SPLICEPOINT; return S_OK; } @@ -606,7 +609,10 @@ static HRESULT WINAPI StdMediaSample2_SetPreroll(IMediaSample2 * iface, BOOL bIs TRACE("(%s)\n", bIsPreroll ? "TRUE" : "FALSE"); - This->props.dwSampleFlags = (This->props.dwSampleFlags & ~AM_SAMPLE_PREROLL) | bIsPreroll ? AM_SAMPLE_PREROLL : 0; + if (bIsPreroll) + This->props.dwSampleFlags &= ~AM_SAMPLE_PREROLL; + else + This->props.dwSampleFlags |= AM_SAMPLE_PREROLL; return S_OK; } -- 1.5.4.1