summaryrefslogtreecommitdiff
path: root/examples/example_audio.c
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2016-01-21 03:18:31 +0200
committerTuomas Virtanen <katajakasa@gmail.com>2016-01-21 03:18:31 +0200
commitf21a7bbe9f4c2eb00f01f01d5923f25fdcfedbb6 (patch)
tree90b975e2cf2e325acc3ea3f541811000f4a3fcf0 /examples/example_audio.c
parente97b8b89d5b8e072859c4e9a948595fbce0be22c (diff)
Disable video and subtitle streams in audio example
Diffstat (limited to 'examples/example_audio.c')
-rw-r--r--examples/example_audio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/example_audio.c b/examples/example_audio.c
index 1701017..9780c26 100644
--- a/examples/example_audio.c
+++ b/examples/example_audio.c
@@ -64,6 +64,11 @@ int main(int argc, char *argv[]) {
return 1;
}
+ // Disable any video and subtitle streams. If we leave these enabled and then don't
+ // clear the buffers for these sometimes, decoding will block.
+ Kit_SetSourceStream(src, KIT_STREAMTYPE_SUBTITLE, -1);
+ Kit_SetSourceStream(src, KIT_STREAMTYPE_VIDEO, -1);
+
// Print stream information
Kit_StreamInfo sinfo;
fprintf(stderr, "Source streams:\n");
@@ -109,6 +114,9 @@ int main(int argc, char *argv[]) {
audio_dev = SDL_OpenAudioDevice(NULL, 0, &wanted_spec, &audio_spec, 0);
SDL_PauseAudioDevice(audio_dev, 0);
+ // Flush output just in case
+ fflush(stderr);
+
// Start playback
Kit_PlayerPlay(player);