diff options
author | Diego Biurrun <diego@biurrun.de> | 2017-04-26 18:57:54 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2017-05-02 18:50:34 +0200 |
commit | b5f19f7478492307e4b4763aeac3180faf50e17f (patch) | |
tree | 0fb69992023b946295a3130e2066256e3caf88fe /libavcodec/aac_adtstoasc_bsf.c | |
parent | 0ac1fec1c3dacedabbf3dd4122ef4bf8523e688c (diff) |
aac: Split function to parse ADTS header data into public and private part
This makes the currently semi-public avpriv_aac_parse_header() function
private to libavcodec and adds a proper public API function to return
the parts of the ADTS header required in libavformat.
Diffstat (limited to 'libavcodec/aac_adtstoasc_bsf.c')
-rw-r--r-- | libavcodec/aac_adtstoasc_bsf.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libavcodec/aac_adtstoasc_bsf.c b/libavcodec/aac_adtstoasc_bsf.c index 3a83d488c4..778387cabb 100644 --- a/libavcodec/aac_adtstoasc_bsf.c +++ b/libavcodec/aac_adtstoasc_bsf.c @@ -19,8 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "adts_header.h" +#include "adts_parser.h" #include "avcodec.h" -#include "aacadtsdec.h" #include "bsf.h" #include "put_bits.h" #include "get_bits.h" @@ -49,15 +50,15 @@ static int aac_adtstoasc_filter(AVBSFContext *bsfc, AVPacket *out) if (ret < 0) return ret; - if (in->size < AAC_ADTS_HEADER_SIZE) + if (in->size < AV_AAC_ADTS_HEADER_SIZE) goto packet_too_small; - init_get_bits(&gb, in->data, AAC_ADTS_HEADER_SIZE * 8); + init_get_bits(&gb, in->data, AV_AAC_ADTS_HEADER_SIZE * 8); if (bsfc->par_in->extradata && show_bits(&gb, 12) != 0xfff) goto finish; - if (avpriv_aac_parse_header(&gb, &hdr) < 0) { + if (ff_adts_header_parse(&gb, &hdr) < 0) { av_log(bsfc, AV_LOG_ERROR, "Error parsing ADTS frame header!\n"); ret = AVERROR_INVALIDDATA; goto fail; @@ -70,10 +71,10 @@ static int aac_adtstoasc_filter(AVBSFContext *bsfc, AVPacket *out) goto fail; } - in->size -= AAC_ADTS_HEADER_SIZE + 2 * !hdr.crc_absent; + in->size -= AV_AAC_ADTS_HEADER_SIZE + 2 * !hdr.crc_absent; if (in->size <= 0) goto packet_too_small; - in->data += AAC_ADTS_HEADER_SIZE + 2 * !hdr.crc_absent; + in->data += AV_AAC_ADTS_HEADER_SIZE + 2 * !hdr.crc_absent; if (!ctx->first_frame_done) { int pce_size = 0; |