diff options
Diffstat (limited to 'examples/example_custom.c')
-rw-r--r-- | examples/example_custom.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/example_custom.c b/examples/example_custom.c index 507efb1..1d33b0e 100644 --- a/examples/example_custom.c +++ b/examples/example_custom.c @@ -40,7 +40,6 @@ int main(int argc, char *argv[]) { Kit_Player *player = NULL; SDL_AudioSpec wanted_spec, audio_spec; SDL_AudioDeviceID audio_dev; - char audiobuf[AUDIOBUFFER_SIZE]; // Get filename to open if(argc != 2) { @@ -153,6 +152,11 @@ int main(int argc, char *argv[]) { // Start playback Kit_PlayerPlay(player); + // Playback temporary data buffers + char audiobuf[AUDIOBUFFER_SIZE]; + SDL_Rect sources[ATLAS_MAX]; + SDL_Rect targets[ATLAS_MAX]; + // Get movie area size SDL_RenderSetLogicalSize(renderer, pinfo.video.output.width, pinfo.video.output.height); while(run) { @@ -203,8 +207,6 @@ int main(int argc, char *argv[]) { // Refresh subtitle texture atlas and render subtitle frames from it // For subtitles, use screen size instead of video size for best quality - SDL_Rect sources[ATLAS_MAX]; - SDL_Rect targets[ATLAS_MAX]; int got = Kit_GetPlayerSubtitleData(player, subtitle_tex, sources, targets, ATLAS_MAX); for(int i = 0; i < got; i++) { SDL_RenderCopy(renderer, subtitle_tex, &sources[i], &targets[i]); |