1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

avcodec/aac_ac3_parser: Untangle AAC and AC3 parsing error codes

Also remove the (unused) AAC_AC3_PARSE_ERROR_CHANNEL_CFG while at it;
furthermore, fix the documentation of ff_ac3_parse_header()
and (ff|avpriv)_adts_header_parse().

Reviewed-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2023-07-06 23:35:11 +02:00
parent 6c812a80dd
commit ae937c4902
7 changed files with 41 additions and 43 deletions

View File

@@ -64,15 +64,22 @@ typedef struct AC3HeaderInfo {
/** @} */
} AC3HeaderInfo;
typedef enum {
AC3_PARSE_ERROR_SYNC = -0x1030c0a,
AC3_PARSE_ERROR_BSID = -0x2030c0a,
AC3_PARSE_ERROR_SAMPLE_RATE = -0x3030c0a,
AC3_PARSE_ERROR_FRAME_SIZE = -0x4030c0a,
AC3_PARSE_ERROR_FRAME_TYPE = -0x5030c0a,
AC3_PARSE_ERROR_CRC = -0x6030c0a,
} AC3ParseError;
/**
* Parse AC-3 frame header.
* Parse the header up to the lfeon element, which is the first 52 or 54 bits
* depending on the audio coding mode.
* @param[in] gbc BitContext containing the first 54 bits of the frame.
* @param[out] hdr Pointer to struct where header info is written.
* @return Returns 0 on success, -1 if there is a sync word mismatch,
* -2 if the bsid (version) element is invalid, -3 if the fscod (sample rate)
* element is invalid, or -4 if the frmsizecod (bit rate) element is invalid.
* @return 0 on success and AC3_PARSE_ERROR_* values otherwise.
*/
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr);