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?
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
andlibav_11_4.cpp
.What about renaming
libav_0_8.cpp
tolibav.cpp
instead and conditionally usingavcodec_alloc_frame
orav_frame_alloc
,av_free_packet
orav_packet_unref
andavcodec_get_frame_defaults
orav_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?