History

Share the declarations for WELS_EVENT arrays between win32 and unix codepaths

Martin Storsjö committed 12 years ago

Commit ae63f061 parent 71bc52d2 files · +14 −18Browse 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+11−11
@@ -320,20 +320,21 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 319 unmodified lines
320320 "pThreadHandles");
321321 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pThreadHandles), FreeMemorySvc (ppCtx))
322322
323−#ifdef _WIN32
324323 pSmt->pSliceCodedEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pSliceCodedEvent");
325324 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pSliceCodedEvent), FreeMemorySvc (ppCtx))
326325 pSmt->pReadySliceCodingEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum,
327326 "pReadySliceCodingEvent");
328327 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pReadySliceCodingEvent), FreeMemorySvc (ppCtx))
329− pSmt->pFinSliceCodingEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pFinSliceCodingEvent");
330− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pFinSliceCodingEvent), FreeMemorySvc (ppCtx))
331328
332329 pSmt->pUpdateMbListEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pUpdateMbListEvent");
333330 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pUpdateMbListEvent), FreeMemorySvc (ppCtx))
334331 pSmt->pFinUpdateMbListEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pFinUpdateMbListEvent");
335332 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pFinUpdateMbListEvent), FreeMemorySvc (ppCtx))
336333
334+#ifdef _WIN32
335+ pSmt->pFinSliceCodingEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pFinSliceCodingEvent");
336+ WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pFinSliceCodingEvent), FreeMemorySvc (ppCtx))
337+
337338 pSmt->pExitEncodeEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pExitEncodeEvent");
338339 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pExitEncodeEvent), FreeMemorySvc (ppCtx))
339340 #else
@@ -514,11 +515,6 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 174 unmodified lines
514515 ++ iIdx;
515516 }
516517
517−#ifdef _WIN32
518− if (pSmt->pExitEncodeEvent != NULL) {
519− pMa->WelsFree (pSmt->pExitEncodeEvent, "pExitEncodeEvent");
520− pSmt->pExitEncodeEvent = NULL;
521− }
522518 if (pSmt->pSliceCodedEvent != NULL) {
523519 pMa->WelsFree (pSmt->pSliceCodedEvent, "pSliceCodedEvent");
524520 pSmt->pSliceCodedEvent = NULL;
@@ -527,6 +523,11 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 2 unmodified lines
527523 pMa->WelsFree (pSmt->pReadySliceCodingEvent, "pReadySliceCodingEvent");
528524 pSmt->pReadySliceCodingEvent = NULL;
529525 }
526+#ifdef _WIN32
527+ if (pSmt->pExitEncodeEvent != NULL) {
528+ pMa->WelsFree (pSmt->pExitEncodeEvent, "pExitEncodeEvent");
529+ pSmt->pExitEncodeEvent = NULL;
530+ }
530531 if (pSmt->pFinSliceCodingEvent != NULL) {
531532 pMa->WelsFree (pSmt->pFinSliceCodingEvent, "pFinSliceCodingEvent");
532533 pSmt->pFinSliceCodingEvent = NULL;
@@ -573,7 +574,6 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 40 unmodified lines
573574 ++ iIdx;
574575 }
575576
576−#ifdef _WIN32
577577 if (pSmt->pUpdateMbListEvent != NULL) {
578578 pMa->WelsFree (pSmt->pUpdateMbListEvent, "pUpdateMbListEvent");
579579 pSmt->pUpdateMbListEvent = NULL;
@@ -582,12 +582,12 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 2 unmodified lines
582582 pMa->WelsFree (pSmt->pFinUpdateMbListEvent, "pFinUpdateMbListEvent");
583583 pSmt->pFinUpdateMbListEvent = NULL;
584584 }
585−#else
585+#ifndef _WIN32
586586 if (pSmt->pUpdateMbListThrdHandles) {
587587 pMa->WelsFree (pSmt->pUpdateMbListThrdHandles, "pUpdateMbListThrdHandles");
588588 pSmt->pUpdateMbListThrdHandles = NULL;
589589 }
590−#endif//_WIN32
590+#endif//!_WIN32
591591
592592 #ifdef MT_DEBUG
593593 // file handle for debug

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