Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RtmpClient.read returns -1 rather than throwing when no connection #69

Closed
ojw28 opened this issue Jun 4, 2018 · 4 comments
Closed

RtmpClient.read returns -1 rather than throwing when no connection #69

ojw28 opened this issue Jun 4, 2018 · 4 comments

Comments

@ojw28
Copy link

ojw28 commented Jun 4, 2018

Reproduction steps:

  1. Start reading an RTMP live stream, by opening a connection and then repeatedly calling RtmpClient.read, as normal. @jinfanzon can provide you with such a stream via email.
  2. Toggle airplane mode on, then off again whilst reading.
  3. Observe the current RtmpClient.read call ends up returning -1, which is documented to mean that the stream is complete.

It looks to me like returning -1 in this case is incorrect. In ExoPlayer, it causes us to assume the stream has ended and transition the player to its ended state. The RtmpClient.read call should either throw an exception (in which case the player will retry) or read some valid data (if possible, depending on when the method returns relative to when airplane mode is toggled off again). Please could you take a look?

@mekya
Copy link
Contributor

mekya commented Jun 4, 2018

Hi,
Throwing an exception indicating connection with the server is dropped may help you for this issue?

@ojw28
Copy link
Author

ojw28 commented Jun 4, 2018

Yes, if RtmpClient.read were to throw an appropriate exception rather than returning -1 in this case, that would help.

@jinfanzon
Copy link

Hi @mekya - could you please provide me an email adress to send the stream url I'm using.

@jinfanzon
Copy link

Hi @mekya - Will the proposed solution will be implemented in the upcoming releases?

vavadhani referenced this issue in ittiam-systems/LibRtmp-Client-for-Android Jun 21, 2019
Propagate the error codes from RTMP read to nativeRead function and
return errors as expected. This commit also corrects exception throws
from nativeRead.
@ojw28 ojw28 closed this as completed Nov 18, 2019
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

No branches or pull requests

3 participants