edde746 b97a22c213 fix(player): report every AudioTrack release so a failed one can recover
An episode that opens but never plays, forever, with no error and no way out
except force-quitting the app. The reporter's log has the whole shape: media
opens at 85206ms, the first video frame renders, `AudioTrack init failed 0
Config(48000, 252, 5, 40000)` is logged exactly once, and the position never
moves again. Force-quitting fixes it for a while, which is the tell — the state
that breaks recovery is process-wide and static.

`DefaultAudioSink` releases its `AudioOutput` on every flush — every seek, every
renderer disable, every reconfigure — and increments a private static
`pendingReleaseCount` as it does. It decrements only from `Listener::onReleased`.
`RawPositionAudioOutput.release` never called `delegate.release()` for a
cacheable output, and it forwarded `addListener` straight through, so the sink's
listener sat on the real output while the wrapper was parked and the increment
was never balanced. media3's own delivery is lossy too: it posts `onReleased` to
the playback looper, which `ExoPlayer.release()` has already quit by the time the
20ms-delayed release runs, so even a real release drops its decrement at
teardown.

A counter that never returns to zero silently disables media3's escalation of
both init and write failures: `PendingExceptionHolder` arms its throw deadline
only when nothing is pending, and short-circuits every retry while something is.
So the `InitializationException` is never thrown, the audio renderer never
becomes ready, and the player is pinned in `STATE_BUFFERING`. No
`PlaybackException` means `retryAfterAudioTrackError` never runs, which is why
the same failure recovered onto decoded PCM earlier in the same log and hung
outright later.

The wrapper now owns the listener set and answers every flush exactly once: at
once when it parks the track, because a parked track is never going to release;
on the delegate's confirmation for a real release; and from the provider at
teardown, where nothing else ever will. Bitstream outputs are not parked at all —
a direct route is often single-instance and a parked one would block its own
successor.

An eviction therefore builds its replacement while the old AudioTrack is still
going away, as upstream does. Holding the count open across the park to buy
media3 patience for that window was tried and is worse: it pins the counter above
zero for the whole live track after the first seek, which is the hang above.
Refusing to allocate until the release confirms is worse too — the refusal
reaches media3 as an init failure with no pending release to excuse it, so the
200ms deadline starts immediately and a slow TV teardown turns an ordinary config
change into a playback error. If the overlapping allocation does fail, media3
escalates into the audio recovery ladder and the watchdog below backs it up.

Because no amount of accounting hygiene guarantees media3 will raise the next
failure, add the watchdog that was missing. Nothing covered "buffering, holding
data, not moving": the frame watchdog wants `STATE_READY` and zero frames, the
decoder-hang check is cancelled by the first frame, `ResumeStallPolicy` treats a
frozen clock as explicitly not its business, `EndOfStreamPolicy` wants the
position past the duration, and media3's stuck-buffering detector wants an empty
buffer. `BufferingStallPolicy` covers exactly that hole and escalates through the
existing audio ladder — now shared with the exception path — then to the mpv
backend rather than leaving a spinner up.

The watchdog only indicts a player that could have started. `DefaultLoadControl`
is configured to hold playback until 5s is buffered after a rebuffer, so the
stall threshold is derived from that same constant rather than guessing at one,
and a buffer below it reads as starved — the loader's business, not the
renderer's. Starvation also restarts the stall clock, so a minute of network
rebuffering cannot bank the timeout and have the first poll after recovery
report a stall that never happened.

Also raise the passthrough buffer to a second. media3 defaults it to 250ms, which
the AC3 factor doubles to the 40000 bytes that failed here, and 1.10.1's only
retry is to keep halving; upstream adopted the same 1s floor in #3207.

Recovery now resumes from the furthest position reached rather than `lastPosition`,
which the poller writes down as freely as up — a dead clock reporting 0 is how an
audio recovery restarted a resumed episode from the top. On the Dart side the
episode loading flags are cleared on every exit of the in-place reload, not just
the success and rollback paths; a flag stranded by a superseded reload made the
Next button a no-op for the rest of the session.

close #1790
2026-08-05 12:03:05 +02:00
2026-08-05 03:57:31 +00:00
2025-10-22 12:45:29 +02:00
2026-05-18 22:52:51 +02:00
2025-10-22 12:45:29 +02:00
2025-10-22 12:45:29 +02:00

Plezy Logo Plezy

A modern client for Plex, Jellyfin, and Emby on desktop, mobile, and TV. Built with Flutter for native performance and a clean interface.

Website · Screenshots · Download · Contributing · License

Plezy mobile screenshots

Download

Download on the App Store Get it on Google Play Available at the Amazon App Store Get it from Microsoft

Platform Download
macOS DMG (x64, arm64)
Linux x64 .deb · .rpm · .pkg.tar.zst · portable tar.gz
Linux arm64 .deb · .rpm · .pkg.tar.zst · portable tar.gz

Package managers:

  • Nix - Community package by @mio-19 and @MiniHarinn
  • Homebrew (macOS):
    brew tap edde746/plezy https://github.com/edde746/plezy
    brew install --cask plezy
    
  • AUR (Arch Linux) - Community maintained by @jianglai:
    yay -S plezy-bin
    
  • WinGet (Windows):
    winget install edde746.Plezy
    

Features

Browse & Discover

  • Libraries, collections, and playlists — video and audio
  • Discover hub — Continue Watching, Next Up, trending, and recommendations
  • Cross-server search across every connected Plex, Jellyfin, and Emby server
  • Filtering, sorting, and alphabetical jump navigation
  • Folder browsing and folder playback — home-video libraries open in folder view
  • Resolution, HDR/Dolby Vision, and audio-format badges on cards and detail pages
  • Favorites and unwatched library filters1
  • Extras — trailers, deleted scenes, behind-the-scenes

Explore & Requests

  • Explore tab — watchlist, trending, popular, and recommendation rows from Plex Discover2 , Trakt, MyAnimeList, AniList, Simkl, and Seerr3
  • Search any connected catalog source
  • Catalog titles matched back to your own libraries by external ID
  • Seerr — request movies and shows with per-season, 4K, and advanced destination options, and see request status inline
  • Watchlist sync — add and remove titles on Plex, Trakt, MyAnimeList, AniList, and Simkl from anywhere in the app

Playback

  • Wide codec support (HEVC, AV1, VP9, and more)
  • HDR and Dolby Vision4
  • Direct play, or transcode presets from 240p/320 kbps to 1080p/20 Mbps
  • Multi-version switching with per-version file details
  • Full ASS/SSA subtitles with customizable styling
  • Online subtitle search & download2
  • Audio & subtitle choices remembered per title, or follow the server's per-episode selections
  • Progress sync and resume
  • Auto-play next episode with skip intro / skip credits
  • Chapter navigation with thumbnail scrub previews
  • Playback speed from 0.25x to 8x, audio sync offset, sleep timer (fixed durations or end of video)
  • Video zoom 50-200% with pinch, presets, and hotkeys
  • Audio passthrough5 , stereo downmix with center-channel boost, and loudness normalization
  • File Info sheet — every version, file, and stream the server reports
  • Ambient lighting and GLSL shader presets6
  • Picture-in-Picture7
  • Refresh-rate matching8
  • External player launch (VLC, MX Player, etc.) with progress sync back9

Music

  • Music libraries — artist, album, and track browsing with square artwork
  • Album and artist screens with play, shuffle, and Instant Mix
  • Gapless playback with a full play queue — reorder, remove, play next, add to queue
  • Now Playing with synced lyrics10 , persistent mini-player, and sleep timer
  • Background playback with lock-screen, media-key, and notification controls11
  • Offline playback of downloaded albums and tracks
  • Streaming quality presets — Original, 320, 192, or 128 kbps

Live TV & DVR

  • Live TV channel browsing, tuning, and favorites
  • EPG guide with What's On and per-show schedules
  • DVR recording rules, scheduled recordings, and a rememberable recording target library2
  • Multi-server Live TV support where available

Downloads & Offline

  • Download movies, shows, and music for offline playback12
  • Background queue with pause / resume
  • Sync rules for automatic downloads, with per-show "Include Specials"
  • Offline browsing with watch state sync-back on reconnect

Watch Together

  • Synchronized playback with friends
  • Real-time play / pause / seek sync

Integrations

  • Discord Rich Presence13
  • Trakt, MyAnimeList, AniList, and Simkl — ratings, watched sync, and real-time scrobbling14
  • Plezy Remote — control desktop and TV from mobile
  • Watch Next row and tvOS Top Shelf15

Platform & Customization

  • Desktop, mobile, and TV — full D-pad, keyboard, and gamepad support
  • Multiple servers at once — Plex, Jellyfin, and Emby side by side
  • Profiles with per-profile downloads, watch state, and settings; Plex Home switching with PIN
  • Jellyfin and Emby local-server discovery and multiple URLs per server; Quick Connect sign-in16
  • TV layout options — corner spotlight backdrop, full-card artwork, and Force TV mode on desktop
  • Customizable keyboard shortcuts13
  • Metadata and artwork editing
  • Settings import/export
  • Localized in English plus 21 translations

Building from Source

Prerequisites

  • Flutter SDK 3.44.0+
  • A Plex account, or a Jellyfin or Emby server with user credentials

Setup

git clone https://github.com/edde746/plezy.git
cd plezy
flutter pub get
scripts/codegen.sh
flutter run

Code Generation

After modifying model classes or other generated sources:

scripts/codegen.sh

After modifying translations:

dart run slang

Local Checks

scripts/ci_checks.sh

To install the same pre-commit checks locally:

scripts/setup_hooks.sh

End-to-end tests (Android emulator plus a Dockerized Jellyfin fixture):

python3 scripts/run_maestro.py basic

Contributing

See CONTRIBUTING.md for development workflow, formatting, tests, and translation guidelines.

License

Plezy is licensed under GPL-3.0.

Acknowledgments


  1. Jellyfin and Emby only. ↩︎

  2. Plex only. ↩︎

  3. Requires connecting the service under Settings > Services. ↩︎

  4. In-app HDR toggle on Windows, macOS, iOS, and tvOS. Dolby Vision on Android and Apple TV. ↩︎

  5. Desktop, Android TV, and Apple TV. ↩︎

  6. Requires the mpv player backend — unavailable on iOS and tvOS, and Android defaults to ExoPlayer. ↩︎

  7. Android, iOS, and macOS — not on Android TV or Apple TV. ↩︎

  8. Windows, Android, and tvOS. ↩︎

  9. Progress sync on Android. ↩︎

  10. Where your server provides lyrics. ↩︎

  11. tvOS pauses music when the app is backgrounded. ↩︎

  12. Not available on tvOS. ↩︎

  13. Desktop only. ↩︎

  14. Real-time scrobbling on Trakt and Simkl; MyAnimeList and AniList update on completion. ↩︎

  15. Android TV / Fire TV and tvOS. ↩︎

  16. Jellyfin only. ↩︎

S
Description
Modern cross-platform Plex & Jellyfin client built with Flutter
Readme GPL-3.0
223 MiB
Languages
Dart 73.8%
GLSL 13.3%
Kotlin 4.3%
C++ 2.3%
Python 1.7%
Other 4.3%