[FFmpeg-cvslog] af_volume: preserve frame properties
Anton Khirnov
git at videolan.org
Mon Mar 3 23:35:12 CET 2014
ffmpeg | branch: release/2.2 | Anton Khirnov <anton at khirnov.net> | Wed Feb 19 20:55:27 2014 +0100| [58556826a80eb6b59fe08c780080fb8f24c1bae9] | committer: Reinhard Tartler
af_volume: preserve frame properties
(cherry picked from commit 39c2880eeae6930b1036ce1f479afc1e1152c13f)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58556826a80eb6b59fe08c780080fb8f24c1bae9
---
libavfilter/af_volume.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c
index 85d7067..12d496e 100644
--- a/libavfilter/af_volume.c
+++ b/libavfilter/af_volume.c
@@ -229,6 +229,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
AVFilterLink *outlink = inlink->dst->outputs[0];
int nb_samples = buf->nb_samples;
AVFrame *out_buf;
+ int ret;
if (vol->volume == 1.0 || vol->volume_i == 256)
return ff_filter_frame(outlink, buf);
@@ -240,7 +241,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
out_buf = ff_get_audio_buffer(inlink, nb_samples);
if (!out_buf)
return AVERROR(ENOMEM);
- out_buf->pts = buf->pts;
+ ret = av_frame_copy_props(out_buf, buf);
+ if (ret < 0) {
+ av_frame_free(&out_buf);
+ av_frame_free(&buf);
+ return ret;
+ }
}
if (vol->precision != PRECISION_FIXED || vol->volume_i > 0) {
More information about the ffmpeg-cvslog
mailing list