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

Commit 30ddcc2d authored by Ganesh Ganapathi Batta's avatar Ganesh Ganapathi Batta Committed by Matthew Xie
Browse files

Resolved partial uipc channel read issue

When partial data is read the previously read size wasn't
compensated for.  Ensure we don't transmit empty a2dp frames in case
of underrun
Bug 8026551

Change-Id: I4195ed798008378b93343bf7cd266c6e2f11b094
parent a2dc8d8d
Loading
Loading
Loading
Loading
+20 −14
Original line number Diff line number Diff line
@@ -2098,7 +2098,8 @@ static void btif_media_aa_prep_sbc_2_send(UINT8 nb_frame)
        } while (((p_buf->len + btif_media_cb.encoder.u16PacketLength) < btif_media_cb.TxAaMtuSize)
                && (p_buf->layer_specific < 0x0F) && nb_frame);

        /* coverity[SIGN_EXTENSION] False-positive: Parameter are always in range avoiding sign extension*/
        if(p_buf->len)
        {
            btif_media_cb.timestamp += p_buf->layer_specific * blocm_x_subband;

            /* store the time stamp in the buffer to send */
@@ -2120,6 +2121,11 @@ static void btif_media_aa_prep_sbc_2_send(UINT8 nb_frame)
            /* Enqueue the encoded SBC frame in AA Tx Queue */
            GKI_enqueue(&(btif_media_cb.TxAaQ), p_buf);
        }
        else
        {
            GKI_freebuf(p_buf);
        }
    }
}


+1 −1
Original line number Diff line number Diff line
@@ -811,7 +811,7 @@ UDRV_API UINT32 UIPC_Read(tUIPC_CH_ID ch_id, UINT16 *p_msg_evt, UINT8 *p_buf, UI
            return 0;
        }

        n = recv(fd, p_buf, len, 0);
        n = recv(fd, p_buf+n_read, len-n_read, 0);

        //BTIF_TRACE_EVENT1("read %d bytes", n);