[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdereview/phonon/gstreamer
From:       Jens Bache-Wiig <jbache () trolltech ! com>
Date:       2008-01-17 15:32:52
Message-ID: 1200583972.349531.12132.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 762639 by jbache:

This fixes hasVideoChanged not beeing emitted
correctly for multiple media objects in the same
process.



 M  +7 -7      mediaobject.cpp  
 M  +1 -0      mediaobject.h  


--- trunk/kdereview/phonon/gstreamer/mediaobject.cpp #762638:762639
@@ -62,6 +62,7 @@
         , m_totalTime(-1)
         , m_bufferPercent(0)
         , m_hasVideo(false)
+        , m_videoStreamFound(false)
         , m_hasAudio(false)
         , m_seekable(false)
         , m_error(Phonon::NoError)
@@ -222,7 +223,7 @@
     if (addToPipeline(m_videoGraph)) {
         GstPad *videopad = gst_element_get_pad (m_videoGraph, "sink");
         if (!GST_PAD_IS_LINKED (videopad) && (gst_pad_link (pad, videopad) == GST_PAD_LINK_OK)) {
-            m_hasVideo = true;
+            m_videoStreamFound = true;
             m_backend->logMessage("Video track connected");
             // Note that the notify::caps _must_ be installed after linking to work with Dapper
             m_capsHandler = g_signal_connect(pad, "notify::caps", G_CALLBACK(notifyVideoCaps), this);
@@ -678,7 +679,7 @@
     m_aboutToFinishEmitted = false;
     m_source = source;
     m_hasAudio = false;
-    m_hasVideo = false;
+    m_videoStreamFound = false;
     setTotalTime(-1);
 
     // Clear exising meta tags
@@ -740,7 +741,7 @@
 // Called when we are ready to leave the loading state
 void MediaObject::loadingComplete()
 {
-    if (m_hasVideo) {
+    if (m_videoStreamFound) {
         MediaNodeEvent event(MediaNodeEvent::VideoAvailable);
         notify(&event);
     }
@@ -754,9 +755,8 @@
     updateSeekable();
     updateTotalTime();
 
-    static bool hasVideo = false;
-    if (hasVideo != m_hasVideo) {
-        hasVideo = m_hasVideo;
+    if (m_videoStreamFound != m_hasVideo) {
+        m_hasVideo = m_videoStreamFound;
         emit hasVideoChanged(m_hasVideo);
     }
 }
@@ -985,7 +985,7 @@
                 if (state() == Phonon::LoadingState) {
                     // If we have video, wait for setVideoCaps
                     // otherwise we are already done.
-                    if (!m_hasVideo) {
+                    if (!m_videoStreamFound) {
                         loadingComplete();
                     }
 
--- trunk/kdereview/phonon/gstreamer/mediaobject.h #762638:762639
@@ -222,6 +222,7 @@
     qint64 m_totalTime;
     int m_bufferPercent;
     bool m_hasVideo;
+    bool m_videoStreamFound;
     bool m_hasAudio;
     bool m_seekable;
     Phonon::ErrorType m_error;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic