android / uamp

A sample audio app for Android
Apache License 2.0
13.11k stars 3.76k forks source link

Use C.TIME_UNSET instead of -1 for unknown duration #507

Closed fstanis closed 1 year ago

fstanis commented 1 year ago

The javadoc for [getDuration()](https://developer.android.com/reference/androidx/media3/common/Player#getDuration()) in media3 Player says:

Returns the duration of the current content or ad in milliseconds, or TIME_UNSET if the duration is not known.

In my understanding, negative values other than TIME_UNSET aren't valid (although we had to guard against them in e.g. google/horologist#728).