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
456456 WelsEventInit (&pSmt->pFinUpdateMbListEvent[iIdx]);
457457 #else
458458 // 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));
460460 err = WelsEventOpen (&pSmt->pUpdateMbListEvent[iIdx], name);
461461 #if defined(ENABLE_TRACE_MT)
462462 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
463463 #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));
465465 err = WelsEventOpen (&pSmt->pFinUpdateMbListEvent[iIdx], name);
466466 #if defined(ENABLE_TRACE_MT)
467467 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
475475 WelsEventInit (&pSmt->pFinSliceCodingEvent[iIdx]);
476476 WelsEventInit (&pSmt->pExitEncodeEvent[iIdx]);
477477 #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));
479479 err = WelsEventOpen (&pSmt->pSliceCodedEvent[iIdx], name);
480480 #if defined(ENABLE_TRACE_MT)
481481 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pSliceCodedEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
482482 #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));
484484 err = WelsEventOpen (&pSmt->pReadySliceCodingEvent[iIdx], name);
485485 #if defined(ENABLE_TRACE_MT)
486486 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
574574 #else
575575 str_t ename[SEM_NAME_MAX] = {0};
576576 // 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));
578578 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));
580580 WelsEventClose (pSmt->pReadySliceCodingEvent[iIdx], ename);
581581 #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));
583583 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));
585585 WelsEventClose (pSmt->pFinUpdateMbListEvent[iIdx], ename);
586586 #endif//DYNAMIC_SLICE_ASSIGN && TRY_SLICING_BALANCE
587587 #endif//_WIN32
@@ -1224,7 +1224,7 @@ int32_t CreateSliceThreads (sWelsEncCtx* pCtx) { · 636 unmodified lines
12241224 dw = SetThreadAffinityMask (pCtx->pSliceThreading->pThreadHandles[iIdx], dwAffinityMask); //1 << iIdx
12251225 if (dw == 0) {
12261226 str_t str[64] = {0};
1227− SNPRINTF (str, 64, "SetThreadAffinityMask iIdx:%d", iIdx);
1227+ WelsSnprintf (str, 64, "SetThreadAffinityMask iIdx:%d", iIdx);
12281228 }
12291229 }
12301230 }

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