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

Fixes a null pointer crash (Github Issue #269) #271

Merged
merged 2 commits into from
Jan 19, 2024

Conversation

vamshi-dhulipala
Copy link
Contributor

  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.
  4. Added unit tests

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.
* @return Duration of the given video track in seconds.
*/
@VisibleForTesting
static float estimateVideoTrackDuration(MediaSource mediaSource, MediaFormat videoTrack) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nip: videoTrackFormat for the second parameter

@izzytwosheds izzytwosheds merged commit 2c73c71 into linkedin:main Jan 19, 2024
2 checks passed
@vamshi-dhulipala vamshi-dhulipala deleted the FIX_NULL_POINTER branch January 19, 2024 18:56
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