summaryrefslogtreecommitdiff
path: root/libswresample
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-14 02:20:33 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-14 02:22:17 +0200
commit6c8ee74af2af032267b6dd109a829d8ea0e7090d (patch)
tree091ec33a6409e655b896ad76a8200e0685e78fe1 /libswresample
parent161ec197ac33cc41913a572dea7daaa17b3ecd3d (diff)
swresample/resample: Fix fractional part of index in the filter_size = 1 filters = 1 case
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/resample_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswresample/resample_template.c b/libswresample/resample_template.c
index 396b4e3055..9269fea5e3 100644
--- a/libswresample/resample_template.c
+++ b/libswresample/resample_template.c
@@ -104,7 +104,7 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int
av_assert1(c->felem_size == sizeof(FELEM));
if(compensation_distance == 0 && c->filter_length == 1 && c->phase_shift==0){
- int64_t index2= ((int64_t)index)<<32;
+ int64_t index2= (1LL<<32)*c->frac/c->src_incr + (1LL<<32)*index;
int64_t incr= (1LL<<32) * c->dst_incr / c->src_incr;
dst_size= FFMIN(dst_size, (src_size-1-index) * (int64_t)c->src_incr / c->dst_incr);