aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2013-08-02 11:07:29 -0400
committerAlexis Ballier <aballier@gentoo.org>2013-08-06 10:18:39 -0400
commit92b886146eca7ef2db8326b258ce72250b63b31a (patch)
treef8d767dc18f12975dcd9bc167acc56e6cf0b4b96 /lib
parent24735200d60631d7126228331d86711db6940052 (diff)
Fix swr_get_delay computation from libavresample API.
Diffstat (limited to 'lib')
-rw-r--r--lib/xbmc-libav-hacks/swresample.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/xbmc-libav-hacks/swresample.c b/lib/xbmc-libav-hacks/swresample.c
index 44e52190c3..349523c5ab 100644
--- a/lib/xbmc-libav-hacks/swresample.c
+++ b/lib/xbmc-libav-hacks/swresample.c
@@ -59,9 +59,10 @@ int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
int64_t swr_get_delay(struct SwrContext *s, int64_t base)
{
- int64_t in_sr;
+ int64_t in_sr, out_sr;
av_opt_get_int(s, "in_sample_rate", 0, &in_sr);
- return avresample_available(s) + av_rescale_rnd(avresample_get_delay(s), base, in_sr, AV_ROUND_UP);
+ av_opt_get_int(s, "out_sample_rate", 0, &out_sr);
+ return av_rescale_rnd(avresample_available(s), base, out_sr, AV_ROUND_UP) + av_rescale_rnd(avresample_get_delay(s), base, in_sr, AV_ROUND_UP);
}
int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map)