Skip to content

fix(linux): audio-only media starts immediately and stops showing loading; GStreamer errors reach the app - #259

Open
muthuraj57 wants to merge 1 commit into
kdroidFilter:masterfrom
muthuraj57:linux-audio-only-and-errors
Open

muthuraj57 wants to merge 1 commit into
kdroidFilter:masterfrom
muthuraj57:linux-audio-only-and-errors

Conversation

@muthuraj57

@muthuraj57 muthuraj57 commented Oct 24, 2026 •

Copy link
Copy Markdown

Summary

  • Audio-only start delay: pollDimensionsUntilReady waited 20 × 250 ms for video dimensions that audio-only media never gets. New native nGetVideoStreamCount (playbin n-video, -1 until prerolled) lets it stop as soon as the pipeline knows there is no video (Linux counterpart of (MacVideoPlayerState) Unable to retrieve valid dimensions after 20 attempts #167/feat: configure macOS video dimensions timeout #252).
  • Endless loading for audio-only: checkBufferingState set isLoading = true because no frames arrive; it now only applies when there is video.
  • Errors were swallowed: GStreamer bus errors were only printed, so a 404, an unreachable host or a missing decoder left the player "playing" at 0:00 or loading forever. The native side keeps the last error (new nConsumeError); a preroll error fails the open with that message, and a later error stops playback and sets VideoPlayerError.SourceError.
  • Unknown duration (e.g. raw ADTS .aac): the position is still updated and end of media still detected.

Test plan

Ubuntu 24.04, GStreamer 1.24, under Xvfb:

  • mp3, wav, Ogg Opus, Ogg Vorbis, WebM Opus, m4a, ADTS aac: start in < 1 s (was ~5 s), isLoading false while playing (was stuck true), seek works; end of media and replay after the end checked on mp3
  • unreachable URL / non-media file: error = "Error opening media: …" within 1 s
  • missing plugin (no plugins-bad, HLS video): error = "Your GStreamer installation is missing a plug-in."
  • HLS video (720p): plays and seeks as before
  • ktlintCheck adds no findings

…; GStreamer errors reach the app

- pollDimensionsUntilReady waited 5 s for video dimensions that audio-only
  media never gets; it now stops as soon as the prerolled pipeline reports no
  video stream (new nGetVideoStreamCount, playbin n-video).
- checkBufferingState set isLoading forever for audio-only media because no
  frames arrive; it now only applies when there is video.
- GStreamer bus errors were only printed. They are kept natively and surfaced
  as VideoPlayerError.SourceError (new nConsumeError), e.g. a missing AAC
  decoder or an HTTP failure, instead of reporting playing at 0:00.
- With an unknown duration (raw ADTS AAC) the position is still shown and
  the end of media still detected.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants