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 29cfeda71a73482c270e87a22e60352c88ba51af..aceee49ab048fa38b2d81b701b5d01ac1fe639df 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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),
index 51812ca7f581674f2c90d22cdd454efbb1b40037..e5d5c9519699b3e07c05350e55b1a70d15e951ba 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",