Skip to content

tc-main: all fixes (CI vehicle) - #2

Draft
muthuraj57 wants to merge 10 commits into
masterfrom
tc-main
Draft

muthuraj57 wants to merge 10 commits into
masterfrom
tc-main

Conversation

@muthuraj57

Copy link
Copy Markdown
Owner

All five fix branches merged (upstream PRs kdroidFilter#255-kdroidFilter#259). Runs Build and Test (natives for every platform, JVM tests, lint) once Actions is enabled on this fork. Not for merging until the publish setup (groupId, secrets) is ready.

…ontent changes

- OpenMedia no longer fails with MF_E_INVALIDSTREAMNUMBER when the source has
  no video stream: the video stream is optional, and media without both video
  and audio is still rejected.
- The audio thread now sees MF_SOURCE_READERF_ENDOFSTREAM (the flag was checked
  after the null-sample early return) and, for audio-only media, sets EOF.
- Seeking after the audio thread exited (end of media) restarts it.
- The producer keeps running after onPlaybackEnded, so seek + play after the
  end works and the next end is reported again.
- Audio-only position/progress come from GetMediaPosition.
- NativeLibraryLoader compared only the file size, so an updated DLL of the same
  size kept the stale cached copy; it now compares the content.

Tested on Windows 11 (x64) with MP3, WAV and Ogg Opus files (duration,
position, seek, end, replay) and an HLS video (unchanged).
…rror no longer blocks on Main

Windows kept _error in a plain field and never cleared it on open, so one
failed source left error set for every later successful one, and Compose did
not observe it (kdroidFilter#253). It is now snapshot state, cleared at the start of each
open. Linux clearError() did runBlocking(Dispatchers.Main), which deadlocks
when called from the UI thread; snapshot state can be written directly.
…me one

It was declared in commonMain, so every consumer shipped it, and its
TestMainDispatcherFactory service can shadow the real Main dispatcher when
service files are merged (fat jars), breaking Dispatchers.Main (kdroidFilter#250). Moved
to commonTest; no main source uses it.
…; 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.
… frame read is using it

Two races in dispose() crashed with EXCEPTION_ACCESS_VIOLATION (kdroidFilter#249):
- It never took mediaOperationMutex, so disposing while openUri was inside
  native OpenMedia destroyed the instance underneath it (reproduced: removing a
  playing player from composition shortly after opening crashes in
  nOpenMedia). dispose() now tears down while holding the mutex, waiting up to
  2 s; if an open is still blocked in native code after that (slow HTTP
  connect), the teardown finishes on a background thread once it returns.
- It waited while jobToJoin.isActive after cancel(), but a cancelled job is no
  longer active, so it never waited for the producer to leave ReadVideoFrame.
  It now waits for isCompleted.
@muthuraj57 muthuraj57 closed this Oct 24, 2026
@muthuraj57 muthuraj57 reopened this Oct 24, 2026
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