[FFmpeg-cvslog] avfilter: check that filter_frame and slice variants are not both used

Michael Niedermayer git at videolan.org
Wed Nov 28 16:49:06 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Nov 28 14:46:46 2012 +0100| [f6dd145533eebdde189adafc791236b2e5419287] | committer: Michael Niedermayer

avfilter: check that filter_frame and slice variants are not both used

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f6dd145533eebdde189adafc791236b2e5419287
---

 libavfilter/avfilter.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index c7384db..d1b6d05 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -409,6 +409,8 @@ AVFilter *avfilter_get_by_name(const char *name)
 
 int avfilter_register(AVFilter *filter)
 {
+    int i;
+
     if (next_registered_avfilter_idx == MAX_REGISTERED_AVFILTERS_NB) {
         av_log(NULL, AV_LOG_ERROR,
                "Maximum number of registered filters %d reached, "
@@ -417,6 +419,12 @@ int avfilter_register(AVFilter *filter)
         return AVERROR(ENOMEM);
     }
 
+    for(i=0; filter->inputs && filter->inputs[i].name; i++) {
+        const AVFilterPad *input = &filter->inputs[i];
+        av_assert0(     !input->filter_frame
+                    || (!input->start_frame && !input->end_frame && !input->draw_slice));
+    }
+
     registered_avfilters[next_registered_avfilter_idx++] = filter;
     return 0;
 }



More information about the ffmpeg-cvslog mailing list