dominikschnitzer / musly

Musly - Music Similarity Library
http://www.musly.org
Mozilla Public License 2.0
138 stars 26 forks source link

vLibav11 4 #25

Closed caux closed 8 years ago

f0k commented 8 years ago

Thanks a lot! This prevents musly from being compiled against older libav versions, though (which is relevant because it may run on servers using a long-term support OS). Furthermore, there are only few differences between libav_0_8.cpp and libav_11_4.cpp.

What about renaming libav_0_8.cpp to libav.cpp instead and conditionally using avcodec_alloc_frame or av_frame_alloc, av_free_packet or av_packet_unref and avcodec_get_frame_defaults or av_frame_unref (do those two actually do the same thing?)? Either by checking the version of the libav headers at compile time, or via some CMake configuration? This would make things compatible with multiple libav versions and avoid code duplication. What do you think?