gst/videotestsrc/gstvideotestsrc.c: Handle 0/1 framerate correctly Fixes #331901.
authorWim Taymans <wim.taymans@gmail.com>
Fri, 28 Apr 2006 14:24:38 +0000 (14:24 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 28 Apr 2006 14:24:38 +0000 (14:24 +0000)
Original commit message from CVS:
* gst/videotestsrc/gstvideotestsrc.c: (gst_video_test_src_create):
Handle 0/1 framerate correctly Fixes #331901.

ChangeLog
gst/videotestsrc/gstvideotestsrc.c

index 29cfeda..aceee49 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-28  Wim Taymans  <wim@fluendo.com>
 
+       * gst/videotestsrc/gstvideotestsrc.c: (gst_video_test_src_create):
+       Handle 0/1 framerate correctly Fixes #331901.
+
+2006-04-28  Wim Taymans  <wim@fluendo.com>
+
        * tests/check/elements/audioconvert.c: (get_float_caps),
        (GST_START_TEST), (audioconvert_suite):
        Added check for correct clipping when doing float samples
index 51812ca..e5d5c95 100644 (file)
@@ -504,6 +504,10 @@ gst_video_test_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
   if (src->fourcc == NULL)
     goto not_negotiated;
 
+  /* 0 framerate and we are at the second frame, eos */
+  if (src->rate_numerator == 0 && src->n_frames == 1)
+    goto eos;
+
   newsize = gst_video_test_src_get_size (src, src->width, src->height);
 
   g_return_val_if_fail (newsize > 0, GST_FLOW_ERROR);
@@ -552,6 +556,11 @@ not_negotiated:
         ("format wasn't negotiated before get function"));
     return GST_FLOW_NOT_NEGOTIATED;
   }
+eos:
+  {
+    GST_DEBUG_OBJECT (src, "eos: 0 framerate and frame %d", src->n_frames);
+    return GST_FLOW_UNEXPECTED;
+  }
 no_buffer:
   {
     GST_DEBUG_OBJECT (src, "could not allocate buffer, reason %s",