Skip to content

Commit a6a0f42

Browse files
authored
Merge pull request jamulussoftware#677 from softins/sequence-audio
Add sequence numbers to audio packets
2 parents 3d4faa0 + d950e8f commit a6a0f42

12 files changed

+438
-33
lines changed

Jamulus.pro

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = 3.5.12git
1+
VERSION = 3.5.12git-softins
22

33
# use target name which does not use a captital letter at the beginning
44
contains(CONFIG, "noupcasename") {
@@ -46,6 +46,7 @@ DEFINES += APP_VERSION=\\\"$$VERSION\\\" \
4646
CUSTOM_MODES \
4747
_REENTRANT
4848

49+
4950
win32 {
5051
DEFINES -= UNICODE # fixes issue with ASIO SDK (asiolist.cpp is not unicode compatible)
5152
DEFINES += NOMINMAX # solves a compiler error in qdatetime.h (Qt5)

src/buffer.cpp

+21-5
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,30 @@ bool CNetBuf::Put ( const CVector<uint8_t>& vecbyData,
5252
{
5353
bool bPutOK = true;
5454

55-
// check if there is not enough space available
56-
if ( GetAvailSpace() < iInSize )
55+
if ( vecbyData[0] == 0xFF )
5756
{
58-
return false;
57+
// sequenced packet - 3 bytes header (SEQ_HEADER_SIZE)
58+
59+
// check if there is not enough space available
60+
if ( GetAvailSpace() < iInSize - SEQ_HEADER_SIZE )
61+
{
62+
return false;
63+
}
64+
65+
// copy new data in internal buffer (implemented in base class)
66+
CBufferBase<uint8_t>::PutSeq ( vecbyData, iInSize - SEQ_HEADER_SIZE, iBlockSize );
5967
}
68+
else
69+
{
70+
// check if there is not enough space available
71+
if ( GetAvailSpace() < iInSize )
72+
{
73+
return false;
74+
}
6075

61-
// copy new data in internal buffer (implemented in base class)
62-
CBufferBase<uint8_t>::Put ( vecbyData, iInSize );
76+
// copy new data in internal buffer (implemented in base class)
77+
CBufferBase<uint8_t>::Put ( vecbyData, iInSize );
78+
}
6379

6480
return bPutOK;
6581
}

0 commit comments

Comments
 (0)