apivideo / api.video-reactnative-live-stream

React Native RTMP live stream client. Made with ♥ by api.video
https://api.video
MIT License
178 stars 33 forks source link

Crash on Android if the livestream is muted. Happens either you mute it midway or start from the muted state. #48

Closed rranjan14 closed 1 year ago

rranjan14 commented 1 year ago

Describe the bug Crashes on muting the livestream only in android.

To Reproduce Steps to reproduce the behavior:

  1. Create a livestream view
  2. Start the stream in muted state or mute it midway.

Expected behavior Should not crash and continue streaming

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

Additional context

FATAL EXCEPTION: AMediaCodecThread
Process: com.instaselllive, PID: 22006
java.lang.IndexOutOfBoundsException: off=0, len=4096 out of bounds (size=3584)
    at java.nio.Buffer.checkBounds(Buffer.java:587)
    at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:304)
    at io.github.thibaultbee.streampack.internal.sources.AudioCapture.getFrame(AudioCapture.kt:134)
    at io.github.thibaultbee.streampack.streamers.bases.BaseStreamer$audioEncoderListener$1.onInputFrame(BaseStreamer.kt:94)
    at io.github.thibaultbee.streampack.internal.encoders.MediaCodecEncoder$encoderCallback$1.onInputBufferAvailable(MediaCodecEncoder.kt:138)
    at android.media.MediaCodec$EventHandler.handleCallback(MediaCodec.java:1824)
    at android.media.MediaCodec$EventHandler.handleMessage(MediaCodec.java:1752)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.os.HandlerThread.run(HandlerThread.java:67)
ThibaultBee commented 1 year ago

Hi,

Thanks for reporting the issue. It seems there is an issue with our native library. Could you test the camera apk in https://github.com/ThibaultBee/StreamPack/suites/9655156872/artifacts/461881276?

rranjan14 commented 1 year ago

Hi, @ThibaultBee I tested the camera apk. This worked fine and it did not crash.

ThibaultBee commented 1 year ago

Hi,

Could you check that your issue is fixed in the main branch?

ThibaultBee commented 1 year ago

This should be fixed in v1.2.2