Repair progressive downloads in DownloadTracker.

They are currently broken because we ignore downloads without periods.
As the DownloadHelper doesn't create periods for progressive media, we don't
download them. Fixing by starting download automatically without showing
track selection dialog.

PiperOrigin-RevId: 236120202
This commit is contained in:
tonihei 2019-02-28 15:42:37 +00:00 committed by Oliver Woodman
parent 84c8842dfa
commit cde6189c14

View file

@ -247,7 +247,10 @@ public class DownloadTracker implements DownloadManager.Listener {
@Override
public void onPrepared(DownloadHelper helper) {
if (helper.getPeriodCount() == 0) {
onPrepareError(helper, new IOException("No periods found."));
Log.d(TAG, "No periods found. Downloading entire stream.");
DownloadAction downloadAction = downloadHelper.getDownloadAction(Util.getUtf8Bytes(name));
startDownload(downloadAction);
downloadHelper.release();
return;
}
mappedTrackInfo = downloadHelper.getMappedTrackInfo(/* periodIndex= */ 0);