diff options
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | examples/alffplay.cpp | 3 | ||||
-rw-r--r-- | examples/alloopback.c | 7 |
3 files changed, 12 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e0a2e6d3..30820f91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1676,7 +1676,7 @@ if(ALSOFT_EXAMPLES) if(SDL2_FOUND) add_executable(alloopback examples/alloopback.c) target_link_libraries(alloopback - PRIVATE ${LINKER_FLAGS} SDL2::SDL2 SDL2::SDL2main ex-common ${MATH_LIB}) + PRIVATE ${LINKER_FLAGS} SDL2::SDL2 ex-common ${MATH_LIB}) if(ALSOFT_INSTALL_EXAMPLES) set(EXTRA_INSTALLS ${EXTRA_INSTALLS} alloopback) @@ -1712,7 +1712,7 @@ if(ALSOFT_EXAMPLES) add_executable(alffplay examples/alffplay.cpp) target_include_directories(alffplay PRIVATE ${FFMPEG_INCLUDE_DIRS}) target_link_libraries(alffplay - PRIVATE ${LINKER_FLAGS} SDL2::SDL2 SDL2::SDL2main ${FFMPEG_LIBRARIES} ex-common) + PRIVATE ${LINKER_FLAGS} SDL2::SDL2 ${FFMPEG_LIBRARIES} ex-common) if(ALSOFT_INSTALL_EXAMPLES) set(EXTRA_INSTALLS ${EXTRA_INSTALLS} alffplay) diff --git a/examples/alffplay.cpp b/examples/alffplay.cpp index ef7aa89d..ae40a51a 100644 --- a/examples/alffplay.cpp +++ b/examples/alffplay.cpp @@ -57,6 +57,7 @@ constexpr auto AVErrorEOF = AVERROR_EOF; struct SwsContext; } +#define SDL_MAIN_HANDLED #include "SDL.h" #ifdef __GNUC__ _Pragma("GCC diagnostic pop") @@ -1899,6 +1900,8 @@ std::ostream &operator<<(std::ostream &os, const PrettyTime &rhs) int main(int argc, char *argv[]) { + SDL_SetMainReady(); + std::unique_ptr<MovieState> movState; if(argc < 2) diff --git a/examples/alloopback.c b/examples/alloopback.c index 7513458b..56cd420f 100644 --- a/examples/alloopback.c +++ b/examples/alloopback.c @@ -30,6 +30,7 @@ #include <math.h> #include <stdio.h> +#define SDL_MAIN_HANDLED #include "SDL.h" #include "SDL_audio.h" #include "SDL_error.h" @@ -141,6 +142,8 @@ int main(int argc, char *argv[]) (void)argc; (void)argv; + SDL_SetMainReady(); + /* Print out error if extension is missing. */ if(!alcIsExtensionPresent(NULL, "ALC_SOFT_loopback")) { @@ -197,6 +200,10 @@ int main(int argc, char *argv[]) attrs[3] = ALC_UNSIGNED_SHORT_SOFT; else if(obtained.format == AUDIO_S16SYS) attrs[3] = ALC_SHORT_SOFT; + else if(obtained.format == AUDIO_S32SYS) + attrs[3] = ALC_INT_SOFT; + else if(obtained.format == AUDIO_F32SYS) + attrs[3] = ALC_FLOAT_SOFT; else { fprintf(stderr, "Unhandled SDL format: 0x%04x\n", obtained.format); |