History

Use WelsSnprintf instead of SNPRINTF

Martin Storsjö committed 12 years ago

Commit f6fe4dd1 parent 6fea0846 files · +29 −117Browse files

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

Unified · Split

codec/encoder/core/src/slice_multi_threading.cpp+9−9
@@ -456,12 +456,12 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 455 unmodified lines
456 WelsEventInit (&pSmt->pFinUpdateMbListEvent[iIdx]);456 WelsEventInit (&pSmt->pFinUpdateMbListEvent[iIdx]);
457#else457#else
458 // length of semaphore name should be system constrained at least on mac 10.7458 // length of semaphore name should be system constrained at least on mac 10.7
459 SNPRINTF (name, SEM_NAME_MAX, "ud%d%p", iIdx, (void*) (*ppCtx));459 WelsSnprintf (name, SEM_NAME_MAX, "ud%d%p", iIdx, (void*) (*ppCtx));
460 err = WelsEventOpen (&pSmt->pUpdateMbListEvent[iIdx], name);460 err = WelsEventOpen (&pSmt->pUpdateMbListEvent[iIdx], name);
461#if defined(ENABLE_TRACE_MT)461#if defined(ENABLE_TRACE_MT)
462 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);462 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
463#endif463#endif
464 SNPRINTF (name, SEM_NAME_MAX, "fu%d%p", iIdx, (void*) (*ppCtx));464 WelsSnprintf (name, SEM_NAME_MAX, "fu%d%p", iIdx, (void*) (*ppCtx));
465 err = WelsEventOpen (&pSmt->pFinUpdateMbListEvent[iIdx], name);465 err = WelsEventOpen (&pSmt->pFinUpdateMbListEvent[iIdx], name);
466#if defined(ENABLE_TRACE_MT)466#if defined(ENABLE_TRACE_MT)
467 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pFinUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);467 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pFinUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
@@ -475,12 +475,12 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 7 unmodified lines
475 WelsEventInit (&pSmt->pFinSliceCodingEvent[iIdx]);475 WelsEventInit (&pSmt->pFinSliceCodingEvent[iIdx]);
476 WelsEventInit (&pSmt->pExitEncodeEvent[iIdx]);476 WelsEventInit (&pSmt->pExitEncodeEvent[iIdx]);
477#else477#else
478 SNPRINTF (name, SEM_NAME_MAX, "sc%d%p", iIdx, (void*) (*ppCtx));478 WelsSnprintf (name, SEM_NAME_MAX, "sc%d%p", iIdx, (void*) (*ppCtx));
479 err = WelsEventOpen (&pSmt->pSliceCodedEvent[iIdx], name);479 err = WelsEventOpen (&pSmt->pSliceCodedEvent[iIdx], name);
480#if defined(ENABLE_TRACE_MT)480#if defined(ENABLE_TRACE_MT)
481 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pSliceCodedEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);481 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pSliceCodedEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
482#endif482#endif
483 SNPRINTF (name, SEM_NAME_MAX, "rc%d%p", iIdx, (void*) (*ppCtx));483 WelsSnprintf (name, SEM_NAME_MAX, "rc%d%p", iIdx, (void*) (*ppCtx));
484 err = WelsEventOpen (&pSmt->pReadySliceCodingEvent[iIdx], name);484 err = WelsEventOpen (&pSmt->pReadySliceCodingEvent[iIdx], name);
485#if defined(ENABLE_TRACE_MT)485#if defined(ENABLE_TRACE_MT)
486 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pReadySliceCodingEvent%d = 0x%p named(%s) ret%d err%d\n", iIdx,486 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pReadySliceCodingEvent%d = 0x%p named(%s) ret%d err%d\n", iIdx,
@@ -574,14 +574,14 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 87 unmodified lines
574#else574#else
575 str_t ename[SEM_NAME_MAX] = {0};575 str_t ename[SEM_NAME_MAX] = {0};
576 // length of semaphore name should be system constrained at least on mac 10.7576 // length of semaphore name should be system constrained at least on mac 10.7
577 SNPRINTF (ename, SEM_NAME_MAX, "sc%d%p", iIdx, (void*) (*ppCtx));577 WelsSnprintf (ename, SEM_NAME_MAX, "sc%d%p", iIdx, (void*) (*ppCtx));
578 WelsEventClose (pSmt->pSliceCodedEvent[iIdx], ename);578 WelsEventClose (pSmt->pSliceCodedEvent[iIdx], ename);
579 SNPRINTF (ename, SEM_NAME_MAX, "rc%d%p", iIdx, (void*) (*ppCtx));579 WelsSnprintf (ename, SEM_NAME_MAX, "rc%d%p", iIdx, (void*) (*ppCtx));
580 WelsEventClose (pSmt->pReadySliceCodingEvent[iIdx], ename);580 WelsEventClose (pSmt->pReadySliceCodingEvent[iIdx], ename);
581#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)581#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
582 SNPRINTF (ename, SEM_NAME_MAX, "ud%d%p", iIdx, (void*) (*ppCtx));582 WelsSnprintf (ename, SEM_NAME_MAX, "ud%d%p", iIdx, (void*) (*ppCtx));
583 WelsEventClose (pSmt->pUpdateMbListEvent[iIdx], ename);583 WelsEventClose (pSmt->pUpdateMbListEvent[iIdx], ename);
584 SNPRINTF (ename, SEM_NAME_MAX, "fu%d%p", iIdx, (void*) (*ppCtx));584 WelsSnprintf (ename, SEM_NAME_MAX, "fu%d%p", iIdx, (void*) (*ppCtx));
585 WelsEventClose (pSmt->pFinUpdateMbListEvent[iIdx], ename);585 WelsEventClose (pSmt->pFinUpdateMbListEvent[iIdx], ename);
586#endif//DYNAMIC_SLICE_ASSIGN && TRY_SLICING_BALANCE586#endif//DYNAMIC_SLICE_ASSIGN && TRY_SLICING_BALANCE
587#endif//_WIN32587#endif//_WIN32
@@ -1224,7 +1224,7 @@ int32_t CreateSliceThreads (sWelsEncCtx* pCtx) { · 636 unmodified lines
1224 dw = SetThreadAffinityMask (pCtx->pSliceThreading->pThreadHandles[iIdx], dwAffinityMask); //1 << iIdx1224 dw = SetThreadAffinityMask (pCtx->pSliceThreading->pThreadHandles[iIdx], dwAffinityMask); //1 << iIdx
1225 if (dw == 0) {1225 if (dw == 0) {
1226 str_t str[64] = {0};1226 str_t str[64] = {0};
1227 SNPRINTF (str, 64, "SetThreadAffinityMask iIdx:%d", iIdx);1227 WelsSnprintf (str, 64, "SetThreadAffinityMask iIdx:%d", iIdx);
1228 }1228 }
1229 }1229 }
1230 }1230 }

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