52 memset(afq, 0,
sizeof(*afq));
77 while (queue_end && queue_end->
next)
78 queue_end = queue_end->
next;
81 if (!(new_frame =
av_malloc(
sizeof(*new_frame))))
101 queue_end->
next = new_frame;
107 af_queue_log_state(afq);
117 int removed_samples = 0;
120 af_queue_log_state(afq);
141 removed_samples += nb_samples;
146 while (removed_samples < nb_samples && afq->frame_queue) {
154 if (removed_samples < nb_samples && afq->remaining_samples > 0) {
156 nb_samples - removed_samples);
157 removed_samples += add_samples;
160 if (removed_samples > nb_samples)
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
This structure describes decoded (raw) audio or video data.
#define AV_LOG_WARNING
Something somehow does not look correct.
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic?ac->func_descr_generic:ac->func_descr)
Macro definitions for various function/variable attributes.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
Initialize AudioFrameQueue.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
void av_log(void *avcl, int level, const char *fmt,...)
int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
Add a frame to the queue.
main external API structure.
rational number numerator/denominator
static void delete_next_frame(AudioFrameQueue *afq)
common internal api header.
common internal and external API header
void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, int *duration)
Remove frame(s) from the queue.
void ff_af_queue_close(AudioFrameQueue *afq)
Close AudioFrameQueue.
static av_always_inline int64_t ff_samples_to_time_base(AVCodecContext *avctx, int64_t samples)
Rescale from sample rate to AVCodecContext.time_base.
int nb_samples
number of audio samples (per channel) described by this frame
#define AV_NOPTS_VALUE
Undefined timestamp value.