diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-25 01:13:42 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-25 01:13:42 +0400 |
commit | 6b06f9f1bc4c51a96186021bf0f99599e49aff47 (patch) | |
tree | 4ad4bfbdca41249f208238a065b33950213f6b10 /libavfilter/af_volume.c | |
parent | fc10ed2cac71d8bcda80afdb8f1a3112b854fbd5 (diff) | |
parent | 39c2880eeae6930b1036ce1f479afc1e1152c13f (diff) |
Merge commit '39c2880eeae6930b1036ce1f479afc1e1152c13f'
* commit '39c2880eeae6930b1036ce1f479afc1e1152c13f':
af_volume: preserve frame properties
Conflicts:
libavfilter/af_volume.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/af_volume.c')
-rw-r--r-- | libavfilter/af_volume.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c index 269a2a527a..8b5d4c404a 100644 --- a/libavfilter/af_volume.c +++ b/libavfilter/af_volume.c @@ -325,6 +325,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) int nb_samples = buf->nb_samples; AVFrame *out_buf; int64_t pos; + int ret; if (isnan(vol->var_values[VAR_STARTPTS])) { vol->var_values[VAR_STARTPTS] = TS2D(buf->pts); @@ -351,7 +352,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) out_buf = ff_get_audio_buffer(inlink, nb_samples); if (!out_buf) return AVERROR(ENOMEM); - av_frame_copy_props(out_buf, buf); + 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) { |