diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2013-02-17 15:45:12 +0100 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2013-02-21 12:36:35 +0100 |
commit | 01649c79c87cb8c12b2e7e5ab64b5ec4fd5e97ca (patch) | |
tree | c85e272dde2f8c7772f973e4f9e3317a335a3a3c | |
parent | d714576037e384c9489bdc0e9fa8b0a0f85d1d7b (diff) | |
download | ffmpeg-streaming-01649c79c87cb8c12b2e7e5ab64b5ec4fd5e97ca.zip ffmpeg-streaming-01649c79c87cb8c12b2e7e5ab64b5ec4fd5e97ca.tar.gz |
lavfi/buffersrc: set channel layout if it is known.
If buffersrc was configured for frames with an unknown layout,
the incoming frames will have channel_layout = 0.
If the format negotiation has selected a known (and compatible)
channel layout for the link, the frame is assumed to have
that layout, the field must be set before injecting the frame
in the filters.
-rw-r--r-- | libavfilter/buffersrc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 3fdf8d3..d150357 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -121,6 +121,8 @@ int av_buffersrc_add_ref(AVFilterContext *s, AVFilterBufferRef *buf, int flags) CHECK_VIDEO_PARAM_CHANGE(s, c, buf->video->w, buf->video->h, buf->format); break; case AVMEDIA_TYPE_AUDIO: + if (!buf->audio->channel_layout) + buf->audio->channel_layout = c->channel_layout; CHECK_AUDIO_PARAM_CHANGE(s, c, buf->audio->sample_rate, buf->audio->channel_layout, buf->format); break; @@ -370,6 +372,8 @@ static int config_props(AVFilterLink *link) link->sample_aspect_ratio = c->pixel_aspect; break; case AVMEDIA_TYPE_AUDIO: + if (!c->channel_layout) + c->channel_layout = link->channel_layout; break; default: return AVERROR(EINVAL); |