File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -202,10 +202,9 @@ status_t AAH_RXPlayer::getCurrentPosition(int *msec) {
202202}
203203
204204status_t AAH_RXPlayer::getDuration (int *msec) {
205- if (NULL != msec) {
206- *msec = 1 ;
207- }
208- return OK;
205+ // Other media players are returning UNKNOWN_ERROR for streams of unknown
206+ // length
207+ return UNKNOWN_ERROR;
209208}
210209
211210status_t AAH_RXPlayer::reset () {
Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ void AAH_TXPlayer::onPrepareAsyncEvent() {
410410
411411 mAudioFormat = mAudioSource ->getFormat ();
412412 if (!mAudioFormat ->findInt64 (kKeyDuration , &mDurationUs ))
413- mDurationUs = 1 ;
413+ mDurationUs = - 1 ;
414414
415415 const char * mime_type = NULL ;
416416 if (!mAudioFormat ->findCString (kKeyMIMEType , &mime_type)) {
@@ -1061,7 +1061,7 @@ void AAH_TXPlayer::onBufferingUpdate() {
10611061 }
10621062 } else {
10631063 int64_t bitrate;
1064- if (getBitrate_l (&bitrate)) {
1064+ if (getBitrate_l (&bitrate) && mDurationUs > 0 ) {
10651065 size_t cachedSize = mCachedSource ->cachedSize ();
10661066 int64_t cachedDurationUs = cachedSize * 8000000ll / bitrate;
10671067
You can’t perform that action at this time.
0 commit comments