From f21a7bbe9f4c2eb00f01f01d5923f25fdcfedbb6 Mon Sep 17 00:00:00 2001 From: Tuomas Virtanen Date: Thu, 21 Jan 2016 03:18:31 +0200 Subject: Disable video and subtitle streams in audio example --- examples/example_audio.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'examples/example_audio.c') 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); -- cgit v1.2.3