Merge commit 'e3fcb14347466095839c2a3c47ebecff02da891e'
[ffmpeg.git] / libavfilter / af_aecho.c
index 4779f7b..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"
@@ -282,13 +281,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
         av_frame_copy_props(out_frame, frame);
     }
 
-    s->echo_samples(s, s->delayptrs, frame->data, out_frame->data,
+    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);
 }
 
@@ -314,7 +314,7 @@ static int request_frame(AVFilterLink *outlink)
                                outlink->channels,
                                frame->format);
 
-        s->echo_samples(s, s->delayptrs, frame->data, frame->data,
+        s->echo_samples(s, s->delayptrs, frame->extended_data, frame->extended_data,
                         frame->nb_samples, outlink->channels);
 
         frame->pts = s->next_pts;
@@ -346,7 +346,7 @@ static const AVFilterPad aecho_outputs[] = {
     { NULL }
 };
 
-AVFilter avfilter_af_aecho = {
+AVFilter ff_af_aecho = {
     .name          = "aecho",
     .description   = NULL_IF_CONFIG_SMALL("Add echoing to the audio."),
     .query_formats = query_formats,