]> git.vomp.tv Git - vompclient.git/commitdiff
Remove non-functioning code in AudioOMX, remove badMinimum
authorChris Tallon <chris@vomp.tv>
Tue, 6 Aug 2024 16:06:20 +0000 (16:06 +0000)
committerChris Tallon <chris@vomp.tv>
Tue, 6 Aug 2024 16:06:20 +0000 (16:06 +0000)
src/audioomx.cc
src/audioomx.h

index 0be7e27bdf917cac2344392944de96b0ee20510f..12dc5afe4378ee277dbc8b296753e9443f7885ac 100644 (file)
@@ -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
index d7c354ea2d77f95572f1038d5d4dc74cd99cbad0..224c3dcd7968125ddd3259114b6cfcef38927beb 100644 (file)
@@ -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);
 };