Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tuuhin
Copy link
Owner

@tuuhin tuuhin commented Nov 7, 2025

Bug fixes

  • There was an unwanted crash with player visualizer
  • Sharing Audio file from the player screen share option works

Others

  • Updated the dependencies to their latest versions
  • Moved visualization logic to its separate module

tuuhin added 10 commits November 3, 2025 08:30
In the intent in ShareRecordingsUtilImpl.kt
the intent stream extra was not mentioned,thus file content was unable to be shared.
Included a lifecycle owner as we are creating threads they need to cleared off
CoroutineLifecycleOwner.kt mimics the lifecycle of viewmodel coroutine scope thus ensures when the scope cancels the threads are also stopped
Corrected name exceptions
The core is quite same as earlier, but
MediaCodecPCMDataDecoder.kt not managing any handlerThreads here initCodec takes up a handler that can be still run on the main thread
Thus codec is only responsible for decoding audio buffers
Corrected names  for MediaCodecState.kt
The ThreadLifecycleHandler.kt manages creation of thread, for each instance only a single thread instance is managed
Though still some worked required as its crashing sometime , we create the thread on start and on destroy we stop it
Also when the MediaCodecPCMDataDecoder.kt work is done ie the end of stream is received we clean the native objects
The recorder timeline was malformatted the seconds field was giving incorrect values corrected that
The end of the stream was handled but end of stream cleanup was not called
MediaCodec.Callback() onInputBufferAvailable can only queue the buffer not set the _codec state based on the codec buffer info the release state is set,
Include locks for batch operations
Still the crashing issue is same as the previous time
Removed Visualizer from PlayerControllerModule.kt
In AudioVisualizerImpl.kt, the ThreadController.kt is provided via constructor injection, also included lock in releaseObjects
MediaCodecPCMDataDecoder.kt handler need to be passed via constructor then later it need to be initiated ,If we are using custom handler then posting cleanup logic in the specified thread  this again reduce the no of crashes
ThreadController.kt the interface for threading logic, in its impl the core logic is same we prepare the thread an on lifecycle destroyed the handler thread quits and cancels
In PlayerVisualizerViewmodel.kt removed the viewmodel onclear super call its not needed
The media extractor instance is now managed by MediaCodecPCMDataDecoder.kt thus no more native exception as media extractor was released synchronously
Thus MediaCodecPCMDataDecoder.kt manages the whole pcm/ rms extraction process
Thread wait time reduced to 600 millis
RecorderViewModel.kt no onClear super call required
As a new module is added module graph updated
Build version no incremented
Few of dependencies versions were updated
We are mistakenly calling prepare visuals twice so added a flag there to ensure it's not called twice
The VisualizerState.kt rather than isReady boolean gives more info about the state of the visualizer.
@tuuhin tuuhin changed the title Issues with the player visualizer Issues with the player visualizer and others Nov 7, 2025
@tuuhin tuuhin merged commit c0388f5 into main Nov 7, 2025
2 checks passed
@tuuhin tuuhin deleted the bug-fixes branch November 7, 2025 18:47
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