Ensure compatibility to older libav versions
- Do not use av_get_packed_sample_fmt
- Include libavutil/channel_layout.h only if it exists