~siretart/ubuntu/utopic/libav/libav10

« back to all changes in this revision

Viewing changes to libavresample/resample.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2014-05-11 12:28:45 UTC
  • mfrom: (1.1.22) (2.1.38 experimental)
  • Revision ID: package-import@ubuntu.com-20140511122845-gxvpts83i958y0i5
Tags: 6:10.1-1
* New upstream release 10:
   - pcm-dvd: Fix 20bit decoding (bug/592)
   - avi: Improve non-interleaved detection (bug/666)
   - arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6
   - arm: hpeldsp: prevent overreads in armv6 asm (bug/646)
   - avfilter: Add missing emms_c when needed
   - rtmpproto: Check the buffer sizes when copying app/playpath strings
   - swscale: Fix an undefined behaviour
   - vp9: Read the frame size as unsigned
   - dcadec: Use correct channel count in stereo downmix check
   - dcadec: Do not decode the XCh extension when downmixing to stereo
   - matroska: add the Opus mapping
   - matroskadec: read the CodecDelay element
   - rtmpproto: Make sure to pass on the error code if read_connect failed
   - lavr: allocate the resampling buffer with a positive size
   - mp3enc: Properly write bitrate value in XING header (Closes: #736088)
   - golomb: Fix the implementation of get_se_golomb_long
* Drop debian/libav-tools.maintscript. ffserver is no longer found in
  stable, and this seems to cause other problems today (Closes: #742676)

Show diffs side-by-side

added added

removed removed

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