History

Merge some WIN32 ifdefs that were directly next to each other

Martin Storsjö committed 12 years ago

Commit e9c34031 parent 73cc5862 files · +12 −24Browse files

Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 2 files). Show all

Unified · Split

codec/encoder/core/src/slice_multi_threading.cpp+10−17
@@ -332,22 +332,19 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 331 unmodified lines
332332 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pReadySliceCodingEvent), FreeMemorySvc (ppCtx))
333333 pSmt->pFinSliceCodingEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pFinSliceCodingEvent");
334334 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pFinSliceCodingEvent), FreeMemorySvc (ppCtx))
335−#else
336− pSmt->pUpdateMbListThrdHandles = (WELS_THREAD_HANDLE*)pMa->WelsMalloc (sizeof (WELS_THREAD_HANDLE) * iThreadNum,
337− "pUpdateMbListThrdHandles");
338− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pUpdateMbListThrdHandles), FreeMemorySvc (ppCtx))
339−#endif//!_WIN32
340−#ifdef _WIN32
335+
341336 pSmt->pUpdateMbListEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pUpdateMbListEvent");
342337 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pUpdateMbListEvent), FreeMemorySvc (ppCtx))
343338 pSmt->pFinUpdateMbListEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pFinUpdateMbListEvent");
344339 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pFinUpdateMbListEvent), FreeMemorySvc (ppCtx))
345−#endif//_WIN32
346340
347−#ifdef _WIN32
348341 pSmt->pExitEncodeEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pExitEncodeEvent");
349342 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pExitEncodeEvent), FreeMemorySvc (ppCtx))
350−#endif//_WIN32
343+#else
344+ pSmt->pUpdateMbListThrdHandles = (WELS_THREAD_HANDLE*)pMa->WelsMalloc (sizeof (WELS_THREAD_HANDLE) * iThreadNum,
345+ "pUpdateMbListThrdHandles");
346+ WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pUpdateMbListThrdHandles), FreeMemorySvc (ppCtx))
347+#endif//!_WIN32
351348
352349 iIdx = 0;
353350 while (iIdx < iNumSpatialLayers) {
@@ -396,6 +393,10 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 42 unmodified lines
396393 #ifdef _WIN32
397394 WelsEventInit (&pSmt->pUpdateMbListEvent[iIdx]);
398395 WelsEventInit (&pSmt->pFinUpdateMbListEvent[iIdx]);
396+ WelsEventInit (&pSmt->pSliceCodedEvent[iIdx]);
397+ WelsEventInit (&pSmt->pReadySliceCodingEvent[iIdx]);
398+ WelsEventInit (&pSmt->pFinSliceCodingEvent[iIdx]);
399+ WelsEventInit (&pSmt->pExitEncodeEvent[iIdx]);
399400 #else
400401 // length of semaphore name should be system constrained at least on mac 10.7
401402 WelsSnprintf (name, SEM_NAME_MAX, "ud%d%p", iIdx, (void*) (*ppCtx));
@@ -408,14 +409,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 6 unmodified lines
408409 #if defined(ENABLE_TRACE_MT)
409410 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pFinUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
410411 #endif
411−#endif//_WIN32
412−
413−#ifdef _WIN32
414− WelsEventInit (&pSmt->pSliceCodedEvent[iIdx]);
415− WelsEventInit (&pSmt->pReadySliceCodingEvent[iIdx]);
416− WelsEventInit (&pSmt->pFinSliceCodingEvent[iIdx]);
417− WelsEventInit (&pSmt->pExitEncodeEvent[iIdx]);
418−#else
419412 WelsSnprintf (name, SEM_NAME_MAX, "sc%d%p", iIdx, (void*) (*ppCtx));
420413 err = WelsEventOpen (&pSmt->pSliceCodedEvent[iIdx], name);
421414 #if defined(ENABLE_TRACE_MT)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t