[FFmpeg-devel] [PATCH] avformat/ac3dec: detect fairplay encryption

Anton Khirnov anton at khirnov.net
Wed Mar 4 13:11:57 EET 2020


Quoting Sebastian Hubbard (2020-02-20 22:43:53)
> Added id3v2_buf and id3v2_buf_size fields to AVProbeData. When an id3v2
> tag is found at the start of probed content, id3v2_buf is filled with
> a pointer to the start of the tag bytes, and id3v2_buf_size with the
> number of bytes in the tag.
> 
> ac3_eac3_probe checks the tag when present for a private frame with an
> owner identifier of com.apple.streaming.audioDescription, which
> signals that the file is encrypted with an Apple DRM scheme. The CRC
> checksums for such files are for the content post-decryption, and with
> this change they are skipped when Apple DRM is detected. This enables
> ffprobe to detect the stream type, even though it will not be playable.
> 
> Signed-off-by: Sebastian Hubbard <sebh at google.com>
> ---
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 9b9b634ec3..afd1b67b5c 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -448,6 +448,8 @@ typedef struct AVProbeData {
>      unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */
>      int buf_size;       /**< Size of buf except extra allocated bytes */
>      const char *mime_type; /**< mime_type, when known. */
> +    unsigned char *id3v2_buf; /**< Bytes of id3v2 tag if one was found at start of file. */
> +    int id3v2_buf_size; /**< Size of id3v2_buf */

You can't just add fields here, it's an ABI break.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list