media3/libraries
tonihei ca51ed649b Fix single sample handling ProgressiveMediaPeriod when disabling tracks
When deselecting the single sample track and later re-selecting this
track, the current shortcuts in ProgressiveMediaPeriod don't handle
this case correctly and cause assertion failures.

In particular, this change fixes 3 issues:
 1. When re-selecting the single sample track, we have cleared the
    SampleQueue and need to reload the sample. The existing shortcut
    should only be applied to avoid the reload when starting from a
    non-zero position.
 2. When de-selecting the track, ProgressiveMediaPeriod is left in
    an inconsistent state where the sample queues are empty but
    loadingFinished is still true. Fix this by resetting
    loadingFinished to false.
 3. When seeking, we avoid reloading the stream if we can keep
    inside the existing samples. This logic assumes that all
    remaining samples will continue to be loaded in the queue.
    This condition isn't true though for single sample tracks
    that have been de-selected. They appear to support the seek
    inside the queue (=no seek necessary, always supported), but
    still require a new load if there is no ongoing one to load
    the sample. Fix this by checking this implicit assumption
    (still loading, or loading finished).

PiperOrigin-RevId: 642650248
2024-06-12 10:08:10 -07:00
..
2024-03-11 06:45:15 -07:00
2024-06-10 07:34:29 -07:00
2024-02-15 02:35:12 -08:00
2024-02-15 02:35:12 -08:00
2024-02-15 02:35:12 -08:00
2024-06-12 02:52:36 -07:00
2024-06-12 04:03:32 -07:00