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

Cannot only get audio #3

Open
linsyking opened this issue Jun 24, 2023 · 3 comments
Open

Cannot only get audio #3

linsyking opened this issue Jun 24, 2023 · 3 comments

Comments

@linsyking
Copy link

In the sample code, if I remove getvideo, then it will stuck at some point. Is getting audio depending on the video stream?

@icculus
Copy link
Owner

icculus commented Jun 25, 2023

Currently, yes, but it would be trivial to throw away the video internally as an option.

I'll look into adding that.

In the meantime, you can just get the video and free it right away.

@linsyking
Copy link
Author

What is the mechanism behind this?

I found that the video frames and audio packets will come in a strange pattern: 10 video frames and 10 audio packets, and repeat.

So what is the right way to receive them?

@icculus
Copy link
Owner

icculus commented Jun 26, 2023

They are interleaved in the file. The right way is to check for both, deal with them when they arrive, and free them when done. Once it's ahead by too many video frames that haven't been accepted by the app, it stops decoding until the app catches up.

The test directory has examples. testtheoraplay.c just chews through a file as fast as possible, simplesdl.c is a simple media player.

@icculus icculus reopened this Jul 8, 2023
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

2 participants