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

Commit 92f5f589 authored by Jason Simmons's avatar Jason Simmons
Browse files

Do not report a duration for a live stream.

Also, do not clamp the playback position to the duration if the duration
is unknown.

Bug: 6672119
Change-Id: Id18bf3d45d4fe7d5edc2ac2da492ca5b4f217826
parent 1d28fef9
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -202,10 +202,9 @@ status_t AAH_RXPlayer::getCurrentPosition(int *msec) {
}

status_t AAH_RXPlayer::getDuration(int *msec) {
    if (NULL != msec) {
        *msec = 1;
    }
    return OK;
    // Other media players are returning UNKNOWN_ERROR for streams of unknown
    // length
    return UNKNOWN_ERROR;
}

status_t AAH_RXPlayer::reset() {
+2 −2
Original line number Diff line number Diff line
@@ -410,7 +410,7 @@ void AAH_TXPlayer::onPrepareAsyncEvent() {

    mAudioFormat = mAudioSource->getFormat();
    if (!mAudioFormat->findInt64(kKeyDuration, &mDurationUs))
        mDurationUs = 1;
        mDurationUs = -1;

    const char* mime_type = NULL;
    if (!mAudioFormat->findCString(kKeyMIMEType, &mime_type)) {
@@ -1061,7 +1061,7 @@ void AAH_TXPlayer::onBufferingUpdate() {
            }
        } else {
            int64_t bitrate;
            if (getBitrate_l(&bitrate)) {
            if (getBitrate_l(&bitrate) && mDurationUs > 0) {
                size_t cachedSize = mCachedSource->cachedSize();
                int64_t cachedDurationUs = cachedSize * 8000000ll / bitrate;