From f456bbbfc4c3a63d4f096b653db75607d5e1a724 Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 11 Aug 2025 11:50:16 +1000 Subject: [PATCH] fix for issue 1889 --- lib_dec/jbm_jb4sb_fx.c | 4 ++++ lib_util/g192.c | 2 +- readme.txt | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/lib_dec/jbm_jb4sb_fx.c b/lib_dec/jbm_jb4sb_fx.c index 47cc52177..56b840d11 100644 --- a/lib_dec/jbm_jb4sb_fx.c +++ b/lib_dec/jbm_jb4sb_fx.c @@ -419,10 +419,12 @@ JB4_DATAUNIT_HANDLE JB4_AllocDataUnit( JB4_dropFromBuffer( h ); } + /* LOCK JBM MEMORY SLOT BEGIN */ h->nFreeMemorySlots = (UWord16) L_sub( h->nFreeMemorySlots, 1 ); move16(); dataUnit = h->freeMemorySlots[h->nFreeMemorySlots]; h->freeMemorySlots[h->nFreeMemorySlots] = NULL; + /* LOCK JBM MEMORY SLOT END */ assert( dataUnit != NULL ); return dataUnit; @@ -436,8 +438,10 @@ void JB4_FreeDataUnit( { assert( dataUnit != NULL ); assert( h->nFreeMemorySlots < MAX_JBM_SLOTS ); + /* LOCK JBM MEMORY SLOT BEGIN */ h->freeMemorySlots[h->nFreeMemorySlots] = dataUnit; h->nFreeMemorySlots = (UWord16) L_add( h->nFreeMemorySlots, 1 ); + /* LOCK JBM MEMORY SLOT END */ move16(); return; diff --git a/lib_util/g192.c b/lib_util/g192.c index d6c6ec475..f61971ef1 100644 --- a/lib_util/g192.c +++ b/lib_util/g192.c @@ -494,7 +494,7 @@ G192_ERROR G192_WriteVoipFrame_short( uint32_t ssrc = 0; uint16_t rtpSequenceNumber_2 = htons( rtpSequenceNumber ); uint32_t rtpTimeStamp_2 = htonl( rtpTimeStamp ); - uint16_t ssrc_2 = (uint16_t) htonl( ssrc ); + uint32_t ssrc_2 = (uint32_t) htonl( ssrc ); assert( numBits <= IVAS_MAX_BITS_PER_FRAME ); diff --git a/readme.txt b/readme.txt index 17530b7b4..3f8a2f02c 100644 --- a/readme.txt +++ b/readme.txt @@ -150,6 +150,25 @@ executables are "IVAS_cod.exe", "IVAS_dec.exe", "IVAS_rend.exe", and "ISAR_post_rend.exe". All reside in the c-code main directory. + + INTEGRATION AS LIBRARIES + ======================== + +While this package contains the necessary applications to execute the IVAS encoder, +decoder, renderer and ISAR post renderer, it is envisioned that the libraries used +would be integrated into custom applications. + +It should be noted that this library is not thread-safe by default. Thus, when using +the IVAS libraries in a multi-threaded environment, proper synchronization of API +calls is required to prevent race conditions by concurrent access to IVAS internal +state memory, FIFO queues buffers or any other data structures. Potential mechanisms +include e.g. mutexes, spinlocks and semaphores. The API calls are at the present not +optimized for fine-granular locking of just critical sections. Some sensitive +sections have thus been marked with a comment in the form /* LOCK XYZ BEGIN */ and +/* LOCK XYZ END */ to provide guidance where code could be modified to prevent +some potential race conditions. + + RUNNING THE SOFTWARE ==================== -- GitLab