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

Outputs samples for codec delay and final padding #1

Open
sdroege opened this issue Feb 25, 2018 · 8 comments
Open

Outputs samples for codec delay and final padding #1

sdroege opened this issue Feb 25, 2018 · 8 comments

Comments

@sdroege
Copy link
Contributor

sdroege commented Feb 25, 2018

Currently using the Vorbis decoder via rust-av outputs some garbage at the beginning and end, which looks like the codec delay and final padding of the last frame.

It would be good if this could be dropped before passing the data to the caller.

@est31
Copy link
Contributor

est31 commented Feb 25, 2018

I'm not sure, usually they should be cut off? In the lewton library I have code to verify that my output is the very same as the libvorbis output: https://github.com/RustAudio/lewton/blob/master/dev/cmp/tests/vals.rs

@est31
Copy link
Contributor

est31 commented Feb 25, 2018

Oh I see that the comparison code actually discards the first packet... but theoretically it should be empty anyway: https://github.com/RustAudio/lewton/blob/3224e949ff2fbed3e17e6abd31ad6558a4867a4f/dev/cmp/src/lib.rs#L96

@lu-zero
Copy link
Member

lu-zero commented Feb 25, 2018

The fields to deliver this information exist, but it isn't used in the Context layer yet. If you want to beat me at adding it you are welcome :)

@sdroege
Copy link
Contributor Author

sdroege commented Feb 25, 2018

How do they exist exactly? You mean internally and not at the Decoder level yet either?

@sdroege
Copy link
Contributor Author

sdroege commented Feb 25, 2018

Oh I see that the comparison code actually discards the first packet... but theoretically it should be empty anyway

It's also at the end, or are you currently filling the last packet completely always?

@lu-zero
Copy link
Member

lu-zero commented Feb 26, 2018

The fields are convergence_window and delay in CodecParams. The padding samples should be trimmed by setting the sample count in the packet to the correct value.

@sdroege
Copy link
Contributor Author

sdroege commented Feb 26, 2018

Ah I see. But that currently can't be passed to the Decoder, which might make sense to be added.

However for this specific case, would you like the dropping of the samples be implemented at the Context layer or to the specific codec implementation itself?

@lu-zero
Copy link
Member

lu-zero commented Feb 26, 2018

Good point, that structure exists in that shape to be shared across. It could probably live at the Decoder level since those properties should be known by the decoder as well.

Since it is fundamental during the Seek scenario I postponed adding it.

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