camerabin2: Prevent audio source from providing clock
authorRobert Swain <robert.swain@collabora.co.uk>
Thu, 28 Jul 2011 15:56:12 +0000 (12:56 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Tue, 2 Aug 2011 16:39:17 +0000 (13:39 -0300)
The audio source inside camerabin2 is put to READY and back to
PLAYING when starting capture, causing the pipeline to lose its
clock. As camerabin2 isn't put to PAUSED->PLAYING again during
this, a new clock isn't selected for elements.

gst/camerabin2/gstcamerabin2.c

index b444fb2..8d56efb 100644 (file)
@@ -170,9 +170,9 @@ gst_cam_flags_get_type (void)
 {
   static const GFlagsValue values[] = {
     {C_FLAGS (GST_CAM_FLAG_NO_AUDIO_CONVERSION), "Do not use audio conversion "
-        "elements", "no-audio-conversion"},
+          "elements", "no-audio-conversion"},
     {C_FLAGS (GST_CAM_FLAG_NO_VIDEO_CONVERSION), "Do not use video conversion "
-        "elements", "no-video-conversion"},
+          "elements", "no-video-conversion"},
     {0, NULL, NULL}
   };
   static volatile GType id = 0;
@@ -1381,6 +1381,10 @@ gst_camera_bin_create_elements (GstCameraBin2 * camera)
   }
 
   if (new_audio_src) {
+    if (g_object_class_find_property (G_OBJECT_GET_CLASS (camera->audio_src),
+            "provide-clock")) {
+      g_object_set (camera->audio_src, "provide-clock", FALSE, NULL);
+    }
     gst_bin_add (GST_BIN_CAST (camera), gst_object_ref (camera->audio_src));
     gst_bin_add (GST_BIN_CAST (camera), gst_object_ref (camera->audio_volume));
     gst_bin_add (GST_BIN_CAST (camera),