|
|
@@ -1589,7 +1589,7 @@ int main(int argc, char *argv[])
|
|
|
}
|
|
|
|
|
|
if (flushing && !decoded) {
|
|
|
- if (SDL_GetAudioStreamQueued(audio) > 0 && !nodelay) {
|
|
|
+ if (audio && SDL_GetAudioStreamQueued(audio) > 0 && !nodelay) {
|
|
|
/* Wait a little bit for the audio to finish */
|
|
|
SDL_Delay(10);
|
|
|
} else {
|
|
|
@@ -1616,11 +1616,15 @@ quit:
|
|
|
avcodec_free_context(&audio_context);
|
|
|
avcodec_free_context(&video_context);
|
|
|
avformat_close_input(&ic);
|
|
|
- SDL_DestroyRenderer(renderer);
|
|
|
+ if (renderer) {
|
|
|
+ SDL_DestroyRenderer(renderer);
|
|
|
+ }
|
|
|
if (vulkan_context) {
|
|
|
DestroyVulkanVideoContext(vulkan_context);
|
|
|
}
|
|
|
- SDL_DestroyWindow(window);
|
|
|
+ if (window) {
|
|
|
+ SDL_DestroyWindow(window);
|
|
|
+ }
|
|
|
SDL_Quit();
|
|
|
SDLTest_CommonDestroyState(state);
|
|
|
return return_code;
|