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

Bug/aac missing timeline #222

Merged
merged 6 commits into from
Mar 10, 2024

Conversation

dedobbin
Copy link
Contributor

@dedobbin dedobbin commented Aug 29, 2023

Fixes #196

@pdeljanov
Copy link
Owner

Could you please test this with the following command: cat /path/to/your/aac/file.aac | symphonia-play -.

I don't think the seek will work if the input is not a seekable file! You will need to use the seek buffer in these cases.

@dedobbin
Copy link
Contributor Author

dedobbin commented Oct 10, 2023

Alright. As discussed, it now guarantees being rewindable , getting rid of the nasty panic and making it possible to set a max bytes to sample the approximate frames

@dedobbin dedobbin force-pushed the bug/aac-missing-timeline branch 2 times, most recently from 28a49a2 to 0ea6c85 Compare February 9, 2024 19:27
@pdeljanov pdeljanov modified the milestone: v0.5.4 Feb 16, 2024
@pdeljanov
Copy link
Owner

Getting very good results with this last set of changes!

@dedobbin dedobbin force-pushed the bug/aac-missing-timeline branch 3 times, most recently from 01b85f2 to e93994b Compare March 7, 2024 18:42
@dedobbin
Copy link
Contributor Author

dedobbin commented Mar 7, 2024

Alright, fixed all CI problems

Copy link
Owner

@pdeljanov pdeljanov left a comment

Choose a reason for hiding this comment

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

This seems to cause errors when testing with symphonia-check. I'm assuming we're dropping a few initial packets for some reason...

Comment on lines 299 to 306
let step = total_len / 3;
if source.is_seekable() {
let mut new_pos = total_len / 2;

loop {
if new_pos >= total_len {
break;
}
Copy link
Owner

Choose a reason for hiding this comment

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

This is a bit strange to me. You are attempting to seek to and examine 3 location in the file (guessing because you're doing total_len / 3), but you start from the middle of the file (new_pos = total_len / 2) which means you are skipping half of the file.

Assuming you want to sample at points a, b, and c, shouldn't you calculate step = (total_len - original_pos) / 4, and start at new_pos = orignal_pos + step? Diagram below.

         a        b        c
|        |        |        |        |
^ original_pos                      ^ total_len

Copy link
Owner

Choose a reason for hiding this comment

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

This loop could also be made into a for loop:

for new_pos in (original_pos..total_len).step_by(step).skip(1) {

No need for mutable variables!

symphonia-codec-aac/src/adts.rs Outdated Show resolved Hide resolved
break;
}

for _ in 0..=500 {
Copy link
Owner

Choose a reason for hiding this comment

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

500 is a lot of frames! That's over 11 seconds of audio at 44.1 kHz. Can we do a magnitude less?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that seems on the extreme side. I was not sure what numbers to plug in, i lowered it now and it still gives acceptable output to me. Let me know if this works for you or how we should go about finding a sweet spot.

@pdeljanov pdeljanov merged commit 4f41954 into pdeljanov:master Mar 10, 2024
11 checks passed
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.

bug: ADTS timebase missing
2 participants