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

TranscoderUtils.java line 134 #269

Open
Ma7moudHatem opened this issue Dec 5, 2023 · 0 comments
Open

TranscoderUtils.java line 134 #269

Ma7moudHatem opened this issue Dec 5, 2023 · 0 comments

Comments

@Ma7moudHatem
Copy link
Contributor

I have the following crash on my app caused by LiTr lib:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
       at android.media.MediaFormat.getLong(MediaFormat.java:855)
       at com.linkedin.android.litr.utils.TranscoderUtils.estimateVideoTrackBitrate(TranscoderUtils.java:134)
       ...

Could you please fix it as it affected many of my app users?

Extra Info:
LiTr version: com.linkedin.android.litr:litr:1.5.5
Android OS: Different OS versions
Android device: Different Android devices

vamshi-dhulipala added a commit to vamshi-dhulipala/LiTr that referenced this issue Jan 18, 2024
1. Fixes a null pointer in TranscoderUtils when retrieving the duration value from a track by checking if the field is present before accessing it.
2. Updated logic of estimateVideoTrackBitrate API in TranscoderUtils to utilize the source media file duration in cases where track specific duration value is null.
3. Updated logic of createTargetMediaFormat API in MediaTransformer class to use a default bit rate of 10_000_000 when we fail to estimate a valid bitrate from the source media track.
izzytwosheds pushed a commit that referenced this issue Jan 19, 2024
* Fixes a null pointer crash (Github Issue #269)

1. Fixes a null pointer in TranscoderUtils when retrieving the duration value from a track by checking if the field is present before accessing it.
2. Updated logic of estimateVideoTrackBitrate API in TranscoderUtils to utilize the source media file duration in cases where track specific duration value is null.
3. Updated logic of createTargetMediaFormat API in MediaTransformer class to use a default bit rate of 10_000_000 when we fail to estimate a valid bitrate from the source media track.
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

1 participant