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

Commit 525c59e5 authored by Manikanta Kanamarlapudi's avatar Manikanta Kanamarlapudi Committed by Steve Kondik
Browse files

nuplayer: Synchronize video and audio decoders configuration

  Video decoder configuration takes more time than audio
decoder configuration and happens in two different threads
leads to buffer transactions of audio much earlier than video
which results in frame drops in the start of playback. Hence
synchronize both decoders configuration.

Change-Id: Iabc1267c9c70b0e87e0c9043633d2d9ad7548a29
CRs-Fixed: 774777
parent 6efd740d
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -237,7 +237,9 @@ void NuPlayer::Decoder::init() {
void NuPlayer::Decoder::configure(const sp<AMessage> &format) {
    sp<AMessage> msg = new AMessage(kWhatConfigure, id());
    msg->setMessage("format", format);
    msg->post();

    sp<AMessage> response;
    PostAndAwaitResponse(msg, &response);
}

void NuPlayer::Decoder::signalUpdateFormat(const sp<AMessage> &format) {
@@ -613,9 +615,14 @@ void NuPlayer::Decoder::onMessageReceived(const sp<AMessage> &msg) {
    switch (msg->what()) {
        case kWhatConfigure:
        {
            uint32_t replyID;
            CHECK(msg->senderAwaitsResponse(&replyID));

            sp<AMessage> format;
            CHECK(msg->findMessage("format", &format));
            onConfigure(format);

            (new AMessage)->postReply(replyID);
            break;
        }