mpv/audio
wm4 dcfde2934d audio: use idiotic FFmpeg ABI rules for public-except-not-public fields
The FFmpeg API is incredibly weird and inconsistent about this. This is
also a FFmpeg-only issue and nothing like this is in Libav - which
doesn't really show FFmpeg in a very positive light.

(To make it even worse: this is a full-blown Libav API incompatibility,
even though this crap was added for Libav ABI-compatibility. It's
absurd.)

Quoting the FFmpeg header for the AVFrame.channels field:

    /**
     * number of audio channels, only used for audio.
     * Code outside libavutil should access this field using:
     * av_frame_get_channels(frame)
     * - encoding: unused
     * - decoding: Read by user.
     */
    int channels;

It says "should" not must, and it doesn't even mention
av_frame_set_channels(). It's also in the section for public fields (not
below a marker that indicates private fields in a public struct, like
it's done e.g. in AVCodecContext).

But not using the accessor will cause silent failures on ABI changes.
The failure that happened due to this code didn't even make it apparent
what was wrong. So just use the idiotic accessor.

Also harmonize the FFmpeg-cursing in the code. (It's fully justified.)

Fixes #3295.

Note that mpv will still check the exact library version numbers, and
reject mismatches - to protect itself from such issues in the future.
2016-07-24 19:33:20 +02:00
..
decode ad_lavc: work around braindead ffmpeg behavior 2016-07-01 15:51:34 +02:00
filter af_lavcac3enc: use common code for AVFrame setup 2016-07-24 19:06:00 +02:00
out ao_pulse: fix some volume control rounding issues 2016-07-14 18:11:14 +02:00
audio.c audio: use idiotic FFmpeg ABI rules for public-except-not-public fields 2016-07-24 19:33:20 +02:00
audio.h af_lavcac3enc: use common code for AVFrame setup 2016-07-24 19:06:00 +02:00
audio_buffer.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
audio_buffer.h Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
chmap.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
chmap.h Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
chmap_sel.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
chmap_sel.h Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
fmt-conversion.c Update license headers 2015-04-13 12:10:01 +02:00
fmt-conversion.h Update license headers 2015-04-13 12:10:01 +02:00
format.c audio: add af_select_best_samplerate function 2016-03-17 02:31:05 -07:00
format.h audio: add af_select_best_samplerate function 2016-03-17 02:31:05 -07:00