diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 2de7d7b..bc53d8a 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,10 +1,10 @@ + and versionCode = the one below x 100 + the level (17 -> 1708 for Android 2.2, 1716 for 4.1). --> diff --git a/README.md b/README.md index b22edcb..61aec2a 100644 --- a/README.md +++ b/README.md @@ -63,11 +63,12 @@ clock has been reset to before 2024 the certificate date check is skipped rather Bluetooth share one radio, and a lighter stream keeps the speaker from stuttering. * Seeking in a transcoded track restarts the transcode at the new position. * **Read-ahead:** while a track plays, the next two in the queue are fetched whole in the background - (one at a time) and then played from the file; without an SD card only the next one is kept. Plex keeps one - file stream per device and cuts the one in progress when another starts, so whole-file fetches (read-ahead, - downloads, *Download tracks before playing*) ask for the file as a download (`?download=1`), which Plex leaves - out of that rule; otherwise the read-ahead and the player cut each other off. Android 2.x's player keeps only a few seconds of stream buffer, so on weak + (one at a time) and then played from the file; without an SD card only the next one is kept. Android 2.x's player keeps only a few seconds of stream buffer, so on weak Wi-Fi shared with a Bluetooth speaker it used to go silent for seconds at a time. +* **One stream per account:** Plex cuts an account's file stream when any device signed in to it starts another, + so every request for a track's file (playing, read-ahead, downloads) asks for it as a download + (`?download=1`), which Plex leaves out of that rule; otherwise the read-ahead and the player, or two phones + playing at once, cut each other off. A server that refuses downloads gets the plain address. * If a stream fails, Plexamp Lite re-picks the connection and resumes; if it fails again it downloads the whole track first and plays from the SD card. "Download tracks before playing" forces that mode (useful on flaky mobile data). Playback that stalls ("playing" but the time doesn't move diff --git a/spec.md b/spec.md index 8b77efa..8dc7ecd 100644 --- a/spec.md +++ b/spec.md @@ -48,8 +48,8 @@ over a Bluetooth speaker. - This repo's `tools/setup_toolchain.sh`, `make_roots.py` and `signapk.py` prepare the toolchain all the Galaxy Mini apps use: changes there affect every app. - Installs to internal storage (SD-card installs get killed during USB sharing). -- Whole-file fetches of a part (read-ahead, downloads) use `Library.downloadUrls` (`?download=1` first): Plex - cuts a device's file stream when the same device starts another, except for downloads. +- Every request for a track's file (playing, read-ahead, downloads) uses `Library.downloadUrls` (`?download=1` + first): Plex cuts an account's file stream when any device on that account starts another, except downloads. - `platform/api8` and `platform/api16` keep the same `Platform` methods; shared code calls no API the API 8 jar lacks (the api8 compile and Dalvik check catch it). Each build's `versionCode` is the manifest's × 100 + level, same key; both APKs are listed in `../tenda-lite/repo/apps.json`. diff --git a/src/com/minamp/PlayerService.java b/src/com/minamp/PlayerService.java index de025f0..c538f12 100644 --- a/src/com/minamp/PlayerService.java +++ b/src/com/minamp/PlayerService.java @@ -341,8 +341,7 @@ public class PlayerService extends Service implements Engine.Listener, AudioMana final long startAt = (direct || download) ? 0 : (posMs / 1000) * 1000; final java.util.List urls; final int[] order = direct ? null : Library.variantOrder(); - if (direct && download) urls = lib.downloadUrls(it); - else if (direct) { urls = new java.util.ArrayList(); urls.add(lib.directUrl(it)); } + if (direct) urls = lib.downloadUrls(it); else urls = lib.transcodeUrls(it, max, startAt, sess); final String ext = direct ? extFor(it) : "mp3"; File file = null; diff --git a/src/com/minamp/plex/Library.java b/src/com/minamp/plex/Library.java index 3c88996..1074d7a 100644 --- a/src/com/minamp/plex/Library.java +++ b/src/com/minamp/plex/Library.java @@ -203,10 +203,11 @@ public final class Library { } /** - * For fetching a whole file while something may be playing (read-ahead, downloads). Plex keeps one file stream - * per device: a new request for a file cuts the one in progress, so the read-ahead and the player cut each - * other off ("Unexpected end of stream"). A request marked as a download is outside that rule. The plain - * address follows, for a server that refuses downloads (a shared library can). + * The addresses to fetch or stream a track's file from. Plex keeps one file stream per account: a new request + * for a file cuts the one in progress, from any device signed in to the same account (the read-ahead and the + * player cut each other off, "Unexpected end of stream", and so do two phones playing at once). A request + * marked as a download is outside that rule and takes Range like any other. The plain address follows, for a + * server that refuses downloads (a shared library can). Transcodes aren't affected. */ public List downloadUrls(Item t) throws IOException { List l = new ArrayList();