|
3 | 3 | * |
4 | 4 | * Created on: Oct 26.2018 |
5 | 5 | * |
6 | | - * Version 3.0.12d |
| 6 | + * Version 3.0.12e |
7 | 7 | * Updated on: Jul 29.2024 |
8 | 8 | * Author: Wolle (schreibfaul1) |
9 | 9 | * |
@@ -3273,16 +3273,6 @@ void Audio::processLocalFile() { |
3273 | 3273 | if(m_validSamples) { |
3274 | 3274 | return; |
3275 | 3275 | } |
3276 | | - // int bytesDecoded = sendBytes(InBuff.getReadPtr(), InBuff.bufferFilled()); |
3277 | | - // if(bytesDecoded <= InBuff.bufferFilled()) { // avoid InBuff overrun (can be if file is corrupt) |
3278 | | - // if(m_f_playing) { |
3279 | | - // if(bytesDecoded > 2) { |
3280 | | - // InBuff.bytesWasRead(bytesDecoded); |
3281 | | - // return; |
3282 | | - // } |
3283 | | - // } |
3284 | | - // } |
3285 | | - // if(m_codec == CODEC_MP3) AUDIO_INFO("audio file is corrupt --> send EOF"); // no return, fall through |
3286 | 3276 | } |
3287 | 3277 | } |
3288 | 3278 |
|
@@ -3417,6 +3407,7 @@ void Audio::processWebFile() { |
3417 | 3407 | byteCounter = 0; |
3418 | 3408 | chunkSize = 0; |
3419 | 3409 | audioDataCount = 0; |
| 3410 | + m_f_stream = false; |
3420 | 3411 | } |
3421 | 3412 |
|
3422 | 3413 | if(!m_contentlength && !m_f_tts) { |
@@ -3453,11 +3444,11 @@ void Audio::processWebFile() { |
3453 | 3444 | InBuff.bytesWritten(bytesAddedToBuffer); |
3454 | 3445 | } |
3455 | 3446 |
|
3456 | | - if(!m_f_stream) { |
| 3447 | + if(!m_f_stream && m_controlCounter == 100) { |
3457 | 3448 | if((InBuff.freeSpace() > maxFrameSize) && (byteCounter < m_contentlength)) return; |
3458 | 3449 | m_f_stream = true; // ready to play the audio data |
3459 | 3450 | uint16_t filltime = millis() - m_t0; |
3460 | | - AUDIO_INFO("stream ready, buffer filled in %d ms", filltime); |
| 3451 | + AUDIO_INFO("Webfile: stream ready, buffer filled in %d ms", filltime); |
3461 | 3452 | return; |
3462 | 3453 | } |
3463 | 3454 |
|
@@ -3498,11 +3489,11 @@ void Audio::processWebFile() { |
3498 | 3489 | if(m_validSamples) { |
3499 | 3490 | return; |
3500 | 3491 | } // play samples first |
3501 | | - int bytesDecoded = sendBytes(InBuff.getReadPtr(), InBuff.bufferFilled()); |
3502 | | - if(bytesDecoded > 2) { |
3503 | | - InBuff.bytesWasRead(bytesDecoded); |
3504 | | - return; |
3505 | | - } |
| 3492 | + // int bytesDecoded = sendBytes(InBuff.getReadPtr(), InBuff.bufferFilled()); |
| 3493 | + // if(bytesDecoded > 2) { |
| 3494 | + // InBuff.bytesWasRead(bytesDecoded); |
| 3495 | + // return; |
| 3496 | + // } |
3506 | 3497 | } |
3507 | 3498 | } |
3508 | 3499 |
|
|
0 commit comments