Skip to content

Commit 6278ef4

Browse files
committed
determine ts chunksize
1 parent 3685d49 commit 6278ef4

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

examples/DLNA/lib/websrv/websrv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ void WebSrv::show_not_found(){
2222
String WebSrv::calculateWebSocketResponseKey(String sec_WS_key){
2323
// input Sec-WebSocket-Key from client
2424
// output Sec-WebSocket-Accept-Key (used in response message to client)
25-
unsigned char sha1_result[20];
25+
uint8_t sha1_result[20];
2626
String concat = sec_WS_key + WS_sec_conKey;
27-
mbedtls_sha1_ret((unsigned char*)concat.c_str(), concat.length(), (unsigned char*) sha1_result );
27+
mbedtls_sha1((unsigned char*)concat.c_str(), concat.length(), (unsigned char*) sha1_result );
2828
return base64::encode(sha1_result, 20);
2929
}
3030
//--------------------------------------------------------------------------------------------------------------

src/Audio.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
*
44
* Created on: Oct 28.2018
55
*
6-
* Version 3.0.13zg
7-
* Updated on: Jan 01.2025
6+
* Version 3.0.13zh
7+
* Updated on: Jan 04.2025
88
* Author: Wolle (schreibfaul1)
99
*
1010
*/
@@ -3423,15 +3423,14 @@ void Audio::processWebStreamTS() {
34233423
*/
34243424
uint8_t readedBytes = 0;
34253425
uint32_t minBytes = 0;
3426-
if(m_f_chunked && chunkSize == byteCounter) chunkSize += chunkedDataTransfer(&readedBytes);
3426+
if(m_f_chunked && chunkSize == byteCounter) {chunkSize += chunkedDataTransfer(&readedBytes); goto exit;}
34273427
if(chunkSize) minBytes = min3(availableBytes, ts_packetsize - ts_packetPtr, chunkSize - byteCounter);
34283428
else minBytes = min(availableBytes, (uint32_t)(ts_packetsize - ts_packetPtr));
34293429

34303430
int res = _client->read(ts_packet + ts_packetPtr, minBytes);
34313431
if(res > 0) {
34323432
ts_packetPtr += res;
34333433
byteCounter += res;
3434-
if((chunkSize == byteCounter) && (chunkSize % 32768 == 0)) {return;} // recalculate chunk size
34353434
if(ts_packetPtr < ts_packetsize) return; // not enough data yet, the process must be repeated if the packet size (188 bytes) is not reached
34363435
ts_packetPtr = 0;
34373436
if(f_firstPacket) { // search for ID3 Header in the first packet

0 commit comments

Comments
 (0)