[FFmpeg-devel] [PATCH 1/3] lavfi/buffersrc: check channel count changes.

Nicolas George nicolas.george at normalesup.org
Sat Mar 16 18:01:34 CET 2013


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/buffersrc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index 80fd2be..f72e908 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);\
     }
@@ -135,7 +135,7 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx,
         break;
     case AVMEDIA_TYPE_AUDIO:
         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);
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list