strmbase: Use !list_empty() instead of list_count() > 0.
This commit is contained in:
parent
bcd2d0ec5b
commit
155e4fb6d3
|
@ -171,10 +171,10 @@ HRESULT WINAPI OutputQueue_ReceiveMultiple(OutputQueue *pOutputQueue, IMediaSamp
|
|||
list_add_tail(pOutputQueue->SampleList, &qev->entry);
|
||||
(*nSamplesProcessed)++;
|
||||
}
|
||||
LeaveCriticalSection(&pOutputQueue->csQueue);
|
||||
|
||||
if (!pOutputQueue->bBatchExact || list_count(pOutputQueue->SampleList) >= pOutputQueue->lBatchSize)
|
||||
SetEvent(pOutputQueue->hProcessQueue);
|
||||
LeaveCriticalSection(&pOutputQueue->csQueue);
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ VOID WINAPI OutputQueue_SendAnyway(OutputQueue *pOutputQueue)
|
|||
if (pOutputQueue->hThread)
|
||||
{
|
||||
EnterCriticalSection(&pOutputQueue->csQueue);
|
||||
if (list_count(pOutputQueue->SampleList) > 0)
|
||||
if (!list_empty(pOutputQueue->SampleList))
|
||||
{
|
||||
pOutputQueue->bSendAnyway = TRUE;
|
||||
SetEvent(pOutputQueue->hProcessQueue);
|
||||
|
@ -235,14 +235,14 @@ DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue)
|
|||
do
|
||||
{
|
||||
EnterCriticalSection(&pOutputQueue->csQueue);
|
||||
if (list_count(pOutputQueue->SampleList) > 0 &&
|
||||
if (!list_empty(pOutputQueue->SampleList) &&
|
||||
(!pOutputQueue->bBatchExact ||
|
||||
list_count(pOutputQueue->SampleList) >= pOutputQueue->lBatchSize ||
|
||||
pOutputQueue->bSendAnyway
|
||||
)
|
||||
)
|
||||
{
|
||||
while (list_count(pOutputQueue->SampleList) > 0)
|
||||
while (!list_empty(pOutputQueue->SampleList))
|
||||
{
|
||||
IMediaSample **ppSamples;
|
||||
LONG nSamples;
|
||||
|
@ -278,8 +278,6 @@ DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue)
|
|||
HeapFree(GetProcessHeap(),0,ppSamples);
|
||||
|
||||
/* Process Non-Samples */
|
||||
if (list_count(pOutputQueue->SampleList) > 0)
|
||||
{
|
||||
LIST_FOR_EACH_SAFE(cursor, cursor2, pOutputQueue->SampleList)
|
||||
{
|
||||
QueuedEvent *qev = LIST_ENTRY(cursor, QueuedEvent, entry);
|
||||
|
@ -301,7 +299,6 @@ DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue)
|
|||
HeapFree(GetProcessHeap(),0,qev);
|
||||
}
|
||||
}
|
||||
}
|
||||
pOutputQueue->bSendAnyway = FALSE;
|
||||
}
|
||||
LeaveCriticalSection(&pOutputQueue->csQueue);
|
||||
|
|
Loading…
Reference in New Issue