Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9d04e9a authored by Andre Eisenbach's avatar Andre Eisenbach Committed by Android (Google) Code Review
Browse files

Merge "Prevent A2DP bit pool calculation endless loops."

parents 48dc17ef d0cc2529
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1968,10 +1968,15 @@ static void btif_media_task_enc_update(BT_HDR *p_msg)
            else if (s16BitPool < pUpdateAudio->MinBitPool)
            {
                APPL_TRACE_WARNING("btif_media_task_enc_update computed bitpool too small (%d)", s16BitPool);

                /* Increase bitrate */
                UINT16 previous_u16BitRate = btif_media_cb.encoder.u16BitRate;
                btif_media_cb.encoder.u16BitRate += BTIF_MEDIA_BITRATE_STEP;
                /* Record that we have increased the bitrate */
                protect |= 2;
                /* Check over-flow */
                if (btif_media_cb.encoder.u16BitRate < previous_u16BitRate)
                    protect |= 3;
            }
            else
            {