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

Commit 9af566a4 authored by Wei Jia's avatar Wei Jia
Browse files

NuPlayer2Driver: send MEDIA2_INFO_DATA_SOURCE_REPEAT when looping

Test: cts test
Bug: 109928575
Change-Id: Iaacaa2fa9f957244d305d821d76e5139164e2b35
parent 6d567e1f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -107,6 +107,9 @@ enum media2_info_type {
    // The player just completed the playback of all data sources.
    // But this is not visible in native code. Just keep this entry for completeness.
    MEDIA2_INFO_DATA_SOURCE_LIST_END = 6,
    // The player just completed an iteration of playback loop. This event is sent only when
    // looping is enabled.
    MEDIA2_INFO_DATA_SOURCE_REPEAT = 7,

    //1xx
    // The player just prepared a data source.
+6 −1
Original line number Diff line number Diff line
@@ -930,7 +930,12 @@ void NuPlayer2Driver::notifyListener_l(
                            // the last little bit of audio. In looping mode, we need to restart it.
                            mAudioSink->start();
                        }
                        // don't send completion event when looping

                        sp<AMessage> notify = new AMessage(kWhatNotifyListener, this);
                        notify->setInt64("srcId", srcId);
                        notify->setInt32("messageId", MEDIA2_INFO);
                        notify->setInt32("ext1", MEDIA2_INFO_DATA_SOURCE_REPEAT);
                        notify->post();
                        return;
                    }
                    if (property_get_bool("persist.debug.sf.stats", false)) {