this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix build of AudioToolkit on Ubuntu LTS (older ffmpeg)

+29
+21
src/AudioToolbox/AudioConverterImpl.cpp
··· 114 114 115 115 void AudioConverter::allocateBuffers() 116 116 { 117 + #ifdef HAVE_AV_FRAME_ALLOC 117 118 m_audioFrame = av_frame_alloc(); 119 + #else 120 + m_audioFrame = avcodec_alloc_frame(); 121 + #endif 118 122 119 123 m_audioFrame->nb_samples = 4096; 120 124 m_audioFrame->format = m_encoder->sample_fmt; ··· 289 293 { 290 294 AVFrame* srcaudio; 291 295 296 + #ifdef HAVE_AV_FRAME_ALLOC 292 297 srcaudio = av_frame_alloc(); 293 298 av_frame_unref(srcaudio); 299 + #else 300 + srcaudio = avcodec_alloc_frame(); 301 + avcodec_get_frame_defaults(srcaudio); 302 + #endif 294 303 295 304 try 296 305 { ··· 338 347 } 339 348 end: 340 349 350 + #ifdef HAVE_AV_FRAME_ALLOC 341 351 av_frame_free(&srcaudio); 352 + #else 353 + avcodec_free_frame(&srcaudio); 354 + #endif 342 355 } 343 356 catch (const std::exception& e) 344 357 { 345 358 ERROR() << "Exception: " << e.what(); 359 + #ifdef HAVE_AV_FRAME_ALLOC 346 360 av_frame_free(&srcaudio); 361 + #else 362 + avcodec_free_frame(&srcaudio); 363 + #endif 347 364 } 348 365 catch (OSStatus err) 349 366 { 350 367 ERROR() << "OSStatus error: " << err; 368 + #ifdef HAVE_AV_FRAME_ALLOC 351 369 av_frame_free(&srcaudio); 370 + #else 371 + avcodec_free_frame(&srcaudio); 372 + #endif 352 373 return err; 353 374 } 354 375
+8
src/AudioToolbox/CMakeLists.txt
··· 20 20 include_directories(${DARLING_TOP_DIRECTORY}/src/external/libobjc2) 21 21 include_directories(${DARLING_TOP_DIRECTORY}/basic-headers) 22 22 23 + include(CheckSymbolExists) 24 + 25 + set(CMAKE_REQUIRED_LIBRARIES -lavutil) 26 + check_symbol_exists(av_frame_alloc "libavutil/frame.h" HAVE_AV_FRAME_ALLOC) 27 + if (HAVE_AV_FRAME_ALLOC) 28 + add_definitions(-DHAVE_AV_FRAME_ALLOC) 29 + endif(HAVE_AV_FRAME_ALLOC) 30 + 23 31 set(AudioToolbox_SRCS 24 32 AudioConverter.cpp 25 33 AudioConverterImpl.cpp