diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-17 14:30:26 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-17 14:30:33 +0100 |
commit | 975fbd43addbf70c047167b761ddcf06e8083c14 (patch) | |
tree | 9f33eb323cea5b961dc96f8b71d8d26483eec635 /libavfilter/buffersrc.c | |
parent | fa7031ad37526bc9916e87dda25547ebbb6f4a3b (diff) | |
parent | 7e6c67dd24d767bfa71ec9cfefca5833535aaa84 (diff) |
Merge remote-tracking branch 'cigaes/master'
* cigaes/master:
lavfi/buffersink: fix header.
lavfi/buffersrc: disable deprecated warnings.
lavfi/buffersrc: check channel count changes.
lavfi/buffersrc: set channel layout if it is known.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/buffersrc.c')
-rw-r--r-- | libavfilter/buffersrc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 70da5296d9..a6300156e3 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -68,9 +68,9 @@ typedef struct { av_log(s, AV_LOG_INFO, "Changing frame properties on the fly is not supported by all filters.\n");\ } -#define CHECK_AUDIO_PARAM_CHANGE(s, c, srate, ch_layout, format)\ +#define CHECK_AUDIO_PARAM_CHANGE(s, c, srate, ch_layout, ch_count, format)\ if (c->sample_fmt != format || c->sample_rate != srate ||\ - c->channel_layout != ch_layout) {\ + c->channel_layout != ch_layout || c->channels != ch_count) {\ av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\ return AVERROR(EINVAL);\ } @@ -134,8 +134,11 @@ static int attribute_align_arg av_buffersrc_add_frame_internal(AVFilterContext * frame->format); break; case AVMEDIA_TYPE_AUDIO: + /* For layouts unknown on input but known on link after negotiation. */ + if (!frame->channel_layout) + frame->channel_layout = s->channel_layout; CHECK_AUDIO_PARAM_CHANGE(ctx, s, frame->sample_rate, frame->channel_layout, - frame->format); + av_frame_get_channels(frame), frame->format); break; default: return AVERROR(EINVAL); @@ -169,13 +172,17 @@ static int attribute_align_arg av_buffersrc_add_frame_internal(AVFilterContext * static void compat_free_buffer(void *opaque, uint8_t *data) { AVFilterBufferRef *buf = opaque; + AV_NOWARN_DEPRECATED( avfilter_unref_buffer(buf); + ) } static void compat_unref_buffer(void *opaque, uint8_t *data) { AVBufferRef *buf = opaque; + AV_NOWARN_DEPRECATED( av_buffer_unref(&buf); + ) } int av_buffersrc_add_ref(AVFilterContext *ctx, AVFilterBufferRef *buf, @@ -203,8 +210,10 @@ int av_buffersrc_add_ref(AVFilterContext *ctx, AVFilterBufferRef *buf, goto fail; } + AV_NOWARN_DEPRECATED( if ((ret = avfilter_copy_buf_props(frame, buf)) < 0) goto fail; + ) #define WRAP_PLANE(ref_out, data, data_size) \ do { \ |