lavfi: check that buffer and link properties match.
authorNicolas George <nicolas.george@normalesup.org>
Wed, 12 Sep 2012 19:00:34 +0000 (21:00 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Thu, 13 Sep 2012 18:09:53 +0000 (20:09 +0200)
libavfilter/audio.c
libavfilter/video.c

index ae78ed8a5e283d1cbc7181ff9f65373f6ebdcbed..06702a6043b2d4ae513453a93cb98decea186e62 100644 (file)
@@ -225,6 +225,10 @@ int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
     int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
     int ret = 0;
 
+    av_assert1(samplesref->format                == link->format);
+    av_assert1(samplesref->audio->channel_layout == link->channel_layout);
+    av_assert1(samplesref->audio->sample_rate    == link->sample_rate);
+
     if (!link->min_samples ||
         (!pbuf &&
          insamples >= link->min_samples && insamples <= link->max_samples)) {
index 5294c1b62dc1f6bbd05715c5654581841fe66e6a..d0c95cd1488b657aa4086c6008ec387c7537c430 100644 (file)
@@ -249,6 +249,10 @@ int ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 
     FF_TPRINTF_START(NULL, start_frame); ff_tlog_link(NULL, link, 0); ff_tlog(NULL, " "); ff_tlog_ref(NULL, picref, 1);
 
+    av_assert1(picref->format                     == link->format);
+    av_assert1(picref->video->w                   == link->w);
+    av_assert1(picref->video->h                   == link->h);
+
     if (link->closed) {
         avfilter_unref_buffer(picref);
         return AVERROR_EOF;