• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/minidlna/ffmpeg-2.3.4/libavcodec/

Lines Matching refs:afq

28 av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
30 afq->avctx = avctx;
31 afq->remaining_delay = avctx->delay;
32 afq->remaining_samples = avctx->delay;
33 afq->frame_count = 0;
36 void ff_af_queue_close(AudioFrameQueue *afq)
38 if(afq->frame_count)
39 av_log(afq->avctx, AV_LOG_WARNING, "%d frames left in the queue on closing\n", afq->frame_count);
40 av_freep(&afq->frames);
41 memset(afq, 0, sizeof(*afq));
44 int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
46 AudioFrame *new = av_fast_realloc(afq->frames, &afq->frame_alloc, sizeof(*afq->frames)*(afq->frame_count+1));
49 afq->frames = new;
50 new += afq->frame_count;
54 new->duration += afq->remaining_delay;
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");
65 afq->remaining_delay = 0;
68 afq->remaining_samples += f->nb_samples;
70 afq->frame_count++;
75 void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
82 if (afq->frame_count || afq->frame_alloc) {
83 if (afq->frames->pts != AV_NOPTS_VALUE)
84 out_pts = afq->frames->pts;
86 if(!afq->frame_count)
87 av_log(afq->avctx, AV_LOG_WARNING, "Trying to remove %d samples, but the queue is empty\n", nb_samples);
89 *pts = ff_samples_to_time_base(afq->avctx, out_pts);
91 for(i=0; nb_samples && i<afq->frame_count; i++){
92 int n= FFMIN(afq->frames[i].duration, nb_samples);
93 afq->frames[i].duration -= n;
96 if(afq->frames[i].pts != AV_NOPTS_VALUE)
97 afq->frames[i].pts += n;
99 afq->remaining_samples -= removed_samples;
100 i -= i && afq->frames[i-1].duration;
101 memmove(afq->frames, afq->frames + i, sizeof(*afq->frames) * (afq->frame_count - i));
102 afq->frame_count -= i;
105 av_assert0(!afq->frame_count);
106 av_assert0(afq->remaining_samples == afq->remaining_delay);
107 if(afq->frames && afq->frames[0].pts != AV_NOPTS_VALUE)
108 afq->frames[0].pts += nb_samples;
109 av_log(afq->avctx, AV_LOG_DEBUG, "Trying to remove %d more samples than there are in the queue\n", nb_samples);
112 *duration = ff_samples_to_time_base(afq->avctx, removed_samples);