Skip to content

Commit 859bcdc

Browse files
committed
CodecMTS comments
1 parent 9a99cc3 commit 859bcdc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/AudioTools/AudioCodecs/CodecMTS.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,14 @@ class MTSDecoder : public AudioDecoder {
428428
pesData = pes;
429429
pesDataSize = len;
430430
}
431-
open_pes_data_size -= pesDataSize;
432431

432+
// Recalculate the open data
433+
open_pes_data_size -= pesDataSize;
433434
if (open_pes_data_size < 0) {
434435
return;
435436
}
436437

438+
/// Write the data
437439
LOGI("- writing %d bytes (open: %d)", pesDataSize, open_pes_data_size);
438440
if (p_print) {
439441
size_t result = writeData<uint8_t>(p_print, pesData, pesDataSize);
@@ -446,14 +448,15 @@ class MTSDecoder : public AudioDecoder {
446448
}
447449
}
448450

449-
// check for PES packet start code prefix
451+
/// check for PES packet start code prefix
450452
bool isPESStartCodeValid(uint8_t *pes) {
451453
if (pes[0] != 0) return false;
452454
if (pes[1] != 0) return false;
453455
if (pes[2] != 0x1) return false;
454456
return true;
455457
}
456458

459+
/// Convert the relevant MTSStreamType to a string
457460
const char *toStr(MTSStreamType type) {
458461
switch (type) {
459462
case MTSStreamType::AUDIO_MP3:

0 commit comments

Comments
 (0)