Skip to content

Instantly share code, notes, and snippets.

@justinruggles
Created September 23, 2012 05:37
Show Gist options
  • Save justinruggles/3768991 to your computer and use it in GitHub Desktop.
Save justinruggles/3768991 to your computer and use it in GitHub Desktop.
diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c
index eb2d2f9..58b3837 100644
--- a/libavfilter/af_resample.c
+++ b/libavfilter/af_resample.c
@@ -209,7 +209,8 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
if (ret > 0) {
buf_out->audio->nb_samples = ret;
- if (buf->pts != AV_NOPTS_VALUE) {
+ if (inlink->sample_rate == outlink->sample_rate &&
+ buf->pts != AV_NOPTS_VALUE) {
buf_out->pts = av_rescale_q(buf->pts, inlink->time_base,
outlink->time_base) -
av_rescale(delay, outlink->sample_rate,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment