videotestsrc: fix unit test breaking on duration query
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 10 Jan 2014 14:24:12 +0000 (14:24 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 10 Jan 2014 14:24:12 +0000 (14:24 +0000)
The new switch caused breaks to not break of the main switch
anymore, causing fall through.

gst/videotestsrc/gstvideotestsrc.c

index a804a3c..d82ce2d 100644 (file)
@@ -792,12 +792,13 @@ gst_video_test_src_query (GstBaseSrc * bsrc, GstQuery * query)
                 * GST_SECOND, src->info.fps_d, src->info.fps_n);
             res = TRUE;
             gst_query_set_duration (query, GST_FORMAT_TIME, dur);
                 * GST_SECOND, src->info.fps_d, src->info.fps_n);
             res = TRUE;
             gst_query_set_duration (query, GST_FORMAT_TIME, dur);
-            break;
+            goto done;
           }
           case GST_FORMAT_BYTES:
           }
           case GST_FORMAT_BYTES:
+            res = TRUE;
             gst_query_set_duration (query, GST_FORMAT_BYTES,
                 bsrc->num_buffers * src->info.size);
             gst_query_set_duration (query, GST_FORMAT_BYTES,
                 bsrc->num_buffers * src->info.size);
-            break;
+            goto done;
           default:
             break;
         }
           default:
             break;
         }
@@ -808,6 +809,7 @@ gst_video_test_src_query (GstBaseSrc * bsrc, GstQuery * query)
       res = GST_BASE_SRC_CLASS (parent_class)->query (bsrc, query);
       break;
   }
       res = GST_BASE_SRC_CLASS (parent_class)->query (bsrc, query);
       break;
   }
+done:
   return res;
 }
 
   return res;
 }