Commit cde6189c by tonihei Committed by Oliver Woodman

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
parent 84c8842d
...@@ -247,7 +247,10 @@ public class DownloadTracker implements DownloadManager.Listener { ...@@ -247,7 +247,10 @@ public class DownloadTracker implements DownloadManager.Listener {
@Override @Override
public void onPrepared(DownloadHelper helper) { public void onPrepared(DownloadHelper helper) {
if (helper.getPeriodCount() == 0) { 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; return;
} }
mappedTrackInfo = downloadHelper.getMappedTrackInfo(/* periodIndex= */ 0); mappedTrackInfo = downloadHelper.getMappedTrackInfo(/* periodIndex= */ 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment