1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit '39c2880eeae6930b1036ce1f479afc1e1152c13f'

* commit '39c2880eeae6930b1036ce1f479afc1e1152c13f':
  af_volume: preserve frame properties

Conflicts:
	libavfilter/af_volume.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-02-24 22:13:42 +01:00
commit 6b06f9f1bc

View File

@ -325,6 +325,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
int nb_samples = buf->nb_samples; int nb_samples = buf->nb_samples;
AVFrame *out_buf; AVFrame *out_buf;
int64_t pos; int64_t pos;
int ret;
if (isnan(vol->var_values[VAR_STARTPTS])) { if (isnan(vol->var_values[VAR_STARTPTS])) {
vol->var_values[VAR_STARTPTS] = TS2D(buf->pts); 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); out_buf = ff_get_audio_buffer(inlink, nb_samples);
if (!out_buf) if (!out_buf)
return AVERROR(ENOMEM); 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) { if (vol->precision != PRECISION_FIXED || vol->volume_i > 0) {