Skip to content

Commit

Permalink
Fix LPCM header
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdr428 committed Sep 29, 2023
1 parent 2d64394 commit f11bc1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tsMuxer/lpcmStreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ int LPCMStreamReader::writeAdditionData(uint8_t* dstBuffer, uint8_t* dstEnd, AVP
THROW(ERR_COMMON, "LPCM stream error: Not enough buffer for writing headers")
// write wave header
for (const char c : "RIFF\xff\xff\xff\xffWAVEfmt ") *curPos++ = c;
curPos--;
const auto fmtSize = reinterpret_cast<uint32_t*>(curPos);
*fmtSize = sizeof(WAVEFORMATPCMEX);
curPos += 4;
Expand All @@ -656,6 +657,7 @@ int LPCMStreamReader::writeAdditionData(uint8_t* dstBuffer, uint8_t* dstEnd, AVP
waveFormatPCMEx->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
curPos += sizeof(WAVEFORMATPCMEX);
for (const char c : "data\xff\xff\xff\xff") *curPos++ = c;
curPos--;
}
}
/*
Expand Down
1 change: 1 addition & 0 deletions tsMuxer/wave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void buildWaveHeader(MemoryBlock& waveBuffer, const int samplerate, const uint16
waveBuffer.grow(40 + 28);
uint8_t* curPos = waveBuffer.data();
for (const char c : "RIFF\x00\x00\x00\x00WAVEfmt ") *curPos++ = c;
curPos--;
const auto fmtSize = reinterpret_cast<uint32_t*>(curPos);
*fmtSize = sizeof(WAVEFORMATPCMEX);
curPos += 4;
Expand Down

0 comments on commit f11bc1b

Please sign in to comment.