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

Added recording of last samples in the final frame #886

Merged
merged 3 commits into from
Jan 26, 2018

Conversation

canelzio
Copy link
Contributor

In an audio transcoding operation I noted that final samples were missing in the output file.
So I added the recordMissingSamples() method that takes care of recording final Frame with last missing samples (if any).
This method is called (as first operation) in the stop() method.

In an audio transcoding operation I noted that final samples were missing in the output file.
So I added the recordMissingSamples() method that takes care of recording final Frame with last missing samples (if any).
This method is called (as first operation) in the stop() method.
@saudet
Copy link
Member

saudet commented Jan 24, 2018

I see, looks good thanks! Though recordSamples() is meant to do all the flushing when we pass samples == null. Could we move the logic into an if ... then ... block around
https://github.com/canelzio/javacv/blob/ef9a33932fe1a428469dec406df06374a61f825f/src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java#L1092 or does that cause other problems?

canelzio and others added 2 commits January 24, 2018 17:35
Original flushing mechanism from the stop() method has been restored.
Implemented recordFrameSamples() general method in place of recordMissingSamples().
recordFrameSamples() method is used in the recordSamples() method when:
- frame recording is needed in the normal while(true) cycle
- samples buffer is null (used for flushing the buffer in the stop() method)
@saudet
Copy link
Member

saudet commented Jan 26, 2018

Looks good! Thanks for the contribution

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