23#include "config_components.h"
34#define ADTS_RATES_LCM 28224000
60 "ADTS frame duration changed mid-stream to "
61 "%d samples at %d Hz\n", hdr->samples, hdr->sample_rate);
62 num =
num * (ADTS_RATES_LCM / hdr->sample_rate) +
s->duration_rem;
63 s1->duration =
num / ADTS_RATES_LCM;
64 s->duration_rem =
num % ADTS_RATES_LCM;
68 s->spliced = mismatch;
74 const uint8_t **poutbuf,
int *poutbuf_size,
75 const uint8_t *buf,
int buf_size)
91 if(
s->remaining_size <= buf_size){
92 if(
s->remaining_size && !
s->need_next_header){
94 s->remaining_size = 0;
98 for(
i=
s->remaining_size;
i<buf_size;
i++){
99 s->state = (
s->state<<8) + buf[
i];
100 if((
len=
s->sync(
s->state, &
s->need_next_header, &new_frame_start)))
108 i-=
s->header_size -1;
109 s->remaining_size =
len;
110 if(!new_frame_start || pc->
index+
i<=0){
111 s->remaining_size +=
i;
115 s->remaining_size +=
i;
122 s->remaining_size -=
FFMIN(
s->remaining_size, buf_size);
130 *poutbuf_size = buf_size;
150 while (buf_size > 0) {
200 set_spliced_adts_duration(s1, avctx, &hdr);
209 (bit_rate - avctx->
bit_rate) /
s->frame_number;
int ff_aac_ac3_parse(AVCodecParserContext *s1, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size)
int ff_ac3_find_syncword(const uint8_t *buf, int buf_size)
#define AV_AAC_ADTS_HEADER_SIZE
#define PARSER_FLAG_COMPLETE_FRAMES
#define i(width, name, range_min, range_max)
Public libavutil channel layout APIs header.
common internal and external API header
#define AV_PROFILE_UNKNOWN
@ AV_AUDIO_SERVICE_TYPE_KARAOKE
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask)
Initialize a native channel layout from a bitmask indicating which channels are present.
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
#define AV_LOG_WARNING
Something somehow does not look correct.
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
enum AVChannelOrder order
Channel order used in this layout.
int nb_channels
Number of channels in this layout.
main external API structure.
AVChannelLayout ch_layout
Audio channel layout.
enum AVAudioServiceType audio_service_type
Type of service that the audio stream conveys.
int64_t bit_rate
the average bitrate
int sample_rate
samples per second
int frame_size
Number of samples per channel in an audio frame.
int duration
Duration of the current frame.
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.