MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_af_queue_add

Function ff_af_queue_add

libavcodec/audio_frame_queue.c:44–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
45{
46 AudioFrame *new = av_fast_realloc(afq->frames, &afq->frame_alloc, sizeof(*afq->frames)*(afq->frame_count+1));
47 if(!new)
48 return AVERROR(ENOMEM);
49 afq->frames = new;
50 new += afq->frame_count;
51
52 /* get frame parameters */
53 new->duration = f->nb_samples;
54 new->duration += afq->remaining_delay;
55 if (f->pts != AV_NOPTS_VALUE) {
56 new->pts = av_rescale_q(f->pts,
57 afq->avctx->time_base,
58 (AVRational){ 1, afq->avctx->sample_rate });
59 new->pts -= afq->remaining_delay;
60 if(afq->frame_count && new[-1].pts >= new->pts)
61 av_log(afq->avctx, AV_LOG_WARNING, "Queue input is backward in time\n");
62 } else {
63 new->pts = AV_NOPTS_VALUE;
64 }
65 afq->remaining_delay = 0;
66
67 /* add frame sample count */
68 afq->remaining_samples += f->nb_samples;
69
70 afq->frame_count++;
71
72 return 0;
73}
74
75void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
76 int64_t *duration)

Callers 15

libvorbis_encode_frameFunction · 0.85
ffat_encodeFunction · 0.85
encode_frameFunction · 0.85
ra144_encode_frameFunction · 0.85
aac_encode_frameFunction · 0.85
aptx_encode_frameFunction · 0.85
vorbis_encode_frameFunction · 0.85
libopus_encodeFunction · 0.85
libshine_encode_frameFunction · 0.85
encode_frameFunction · 0.85
mp3lame_encode_frameFunction · 0.85
aac_encode_frameFunction · 0.85

Calls 3

av_fast_reallocFunction · 0.85
av_rescale_qFunction · 0.85
av_logFunction · 0.85

Tested by

no test coverage detected