From 1d9c3e6fe91cf59e8cf189434c364f97cd905e50 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 6 Aug 2024 16:06:20 +0000 Subject: [PATCH] Remove non-functioning code in AudioOMX, remove badMinimum --- src/audioomx.cc | 24 ++++++++++++++++++------ src/audioomx.h | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/audioomx.cc b/src/audioomx.cc index 0be7e27..12dc5af 100644 --- a/src/audioomx.cc +++ b/src/audioomx.cc @@ -2508,11 +2508,21 @@ u4 AudioOMX::DeliverMediaPacket(MediaPacket mpacket, const u1* buffer, u4* sampl //haveToCopy -= badMinimumFunction(len - decompress_buffer_filled, 0); //*samplepos += badMinimumFunction(len - decompress_buffer_filled, 0); - int result = badMinimumFunction(len - decompress_buffer_filled, 0); - haveToCopy -= result; - *samplepos += result; - - abort(); // When does this run? + //int result = badMinimumFunction(len - decompress_buffer_filled, 0); + //LogNT::getInstance()->debug(TAG, "RESULT : {}", result); + //haveToCopy -= result; + //*samplepos += result; + + //abort(); // When does this run? + // 18 months later... This abort finally triggered. There now seems to be some channels which trigger this. + // It's when there's not enough data to decode. This particular bit of code is after this half block + // situation has occured, there is code above which glues the old saved data to new input and runs that + // through libav. This is the cleanup code after this has happened. But - as it was written it never did + // anything. haveToCopy and *samplepos were not moved. However - it works !! Why?? Is it leaking somehow? + // Removing the abort + // Removing the badMinimumFunction + // Commenting out the above lines which move haveToCopy and *samplepos + // Figure out in a future refactor if this needs further fixing // len is always either 0 or the result of avcodec_decode_audio4(current_context, decode_frame_libav, &gotta, &incoming_paket_libav); @@ -2524,6 +2534,7 @@ u4 AudioOMX::DeliverMediaPacket(MediaPacket mpacket, const u1* buffer, u4* sampl //if (current_context->frame_size>0) framesize=min(current_context->frame_size,haveToCopy); /*else*/ framesize = haveToCopy; + } else { @@ -2729,7 +2740,7 @@ void AudioOMX::ResetTimeOffsets() vw->ResetTimeOffsets(); } -// FIXME +/* int AudioOMX::badMinimumFunction(u4 a, int b) { printf("MIN: P1: %u, P2: %i\n", a, b); @@ -2737,6 +2748,7 @@ int AudioOMX::badMinimumFunction(u4 a, int b) if (a > b) return b; else return a; } +*/ int AudioOMX::DO_NOT_USE(AVCodecContext* avctx, // used - sent to avcodec_send_packet AVFrame* frame, // used - object for receive to write to diff --git a/src/audioomx.h b/src/audioomx.h index d7c354e..224c3dc 100644 --- a/src/audioomx.h +++ b/src/audioomx.h @@ -192,7 +192,7 @@ class AudioOMX : public Audio char L_VPE_OMX_AUDIO_REND[128]; - int badMinimumFunction(u4 a, int b); + // int badMinimumFunction(u4 a, int b); int DO_NOT_USE(AVCodecContext* avctx, AVFrame* frame, int* got_frame_ptr, const AVPacket* avpkt); }; -- 2.39.5