Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/glive.py
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2010-04-29 13:51:47 (GMT)
committer Daniel Drake <dan@reactivated.net>2010-04-29 14:52:03 (GMT)
commit157adbc0cac15e60676d1733c49dfa163f8f8838 (patch)
tree57d646adb685dbe1d774c9aea3301df62a1951c6 /glive.py
parentcf7fb15d94b335402e4ddd4cfad2e9e80c517ddd (diff)
Stop pipeline while initiating video capture
This is needed for good A/V sync (gstreamer bug?)
Diffstat (limited to 'glive.py')
-rw-r--r--glive.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/glive.py b/glive.py
index 8e7268b..525fb62 100644
--- a/glive.py
+++ b/glive.py
@@ -406,14 +406,16 @@ class Glive:
OGG_TRAITS[quality]['width'],
OGG_TRAITS[quality]['height'])
- pad = self.videobin.get_static_pad("sink")
- pad.set_blocked_async(True, self.blockedCb, None)
+ # If we use pad blocking and adjust the pipeline on-the-fly, the
+ # resultant video has bad A/V sync :(
+ # If we pause the pipeline while adjusting it, the A/V sync is better
+ # but not perfect :(
+ # so we stop the whole thing while reconfiguring to get the best results
+ self.pipeline.set_state(gst.STATE_NULL)
self.pipeline.add(self.videobin)
- self.videobin.set_state(gst.STATE_PLAYING)
self.pipeline.get_by_name("tee").link(self.videobin)
- pad.set_blocked_async(False, self.blockedCb, None)
self.pipeline.add(self.audiobin)
- self.audiobin.set_state(gst.STATE_PLAYING)
+ self.pipeline.set_state(gst.STATE_PLAYING)
def startRecordingAudio(self):
self.audioPixbuf = None