Merge commit 'e3fcb14347466095839c2a3c47ebecff02da891e'
[ffmpeg.git] / libavfilter / af_aecho.c
index 9c86f8d..c26fdd4 100644 (file)
@@ -16,7 +16,6 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
  */
 
 #include "libavutil/avassert.h"
@@ -285,10 +284,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     s->echo_samples(s, s->delayptrs, frame->extended_data, out_frame->extended_data,
                     frame->nb_samples, inlink->channels);
 
+    s->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rate}, inlink->time_base);
+
     if (frame != out_frame)
         av_frame_free(&frame);
 
-    s->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rate}, inlink->time_base);
     return ff_filter_frame(ctx->outputs[0], out_frame);
 }