~ubuntu-branches/ubuntu/utopic/libav/utopic

« back to all changes in this revision

Viewing changes to libavresample/resample.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2014-05-08 21:40:28 UTC
  • mfrom: (1.3.41 sid)
  • Revision ID: package-import@ubuntu.com-20140508214028-xuainxb1ibzt9lbg
Tags: 6:9.13-1ubuntu1
* Merge from unstable, remaining changes:
  - build-depend on libtiff5-dev rather than libtiff4-dev,
    avoids FTBFS caused by imlib
* New release fixes security issues LP: #1277173

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    void (*resample_one)(struct ResampleContext *c, int no_filter, void *dst0,
47
47
                         int dst_index, const void *src0, int src_size,
48
48
                         int index, int frac);
 
49
    int padding_size;
49
50
};
50
51
 
51
52
 
211
212
        goto error;
212
213
    c->ideal_dst_incr = c->dst_incr;
213
214
 
 
215
    c->padding_size   = (c->filter_length - 1) / 2;
214
216
    c->index = -phase_count * ((c->filter_length - 1) / 2);
215
217
    c->frac  = 0;
216
218
 
461
463
 
462
464
int avresample_get_delay(AVAudioResampleContext *avr)
463
465
{
 
466
    ResampleContext *c = avr->resample;
 
467
 
464
468
    if (!avr->resample_needed || !avr->resample)
465
469
        return 0;
466
470
 
467
 
    return avr->resample->buffer->nb_samples;
 
471
    return FFMAX(c->buffer->nb_samples - c->padding_size, 0);
468
472
}