Clean up QGstreamerPlayerSession
authorAndras Becsi <andras.becsi@digia.com>
Wed, 7 Nov 2012 17:28:10 +0000 (18:28 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 20 Nov 2012 10:54:49 +0000 (11:54 +0100)
Remove dead code and fix compiler warnings about unused
and uninitialized variables.

Change-Id: I809d905e13234db1dbc1b9c2a0ac887c5c712fc7
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp
src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.h

index 1c23a69..a45b2cd 100644 (file)
@@ -127,6 +127,7 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent)
 {
     gboolean result = gst_type_find_register(0, "playlist", GST_RANK_MARGINAL, playlistTypeFindFunction, 0, 0, this, 0);
     Q_ASSERT(result == TRUE);
+    Q_UNUSED(result);
 
     m_playbin = gst_element_factory_make("playbin2", NULL);
 
@@ -418,17 +419,6 @@ void QGstreamerPlayerSession::setActiveStream(QMediaStreamsControl::StreamType s
     }
 }
 
-
-bool QGstreamerPlayerSession::isBuffering() const
-{
-    return false;
-}
-
-int QGstreamerPlayerSession::bufferingProgress() const
-{
-    return 0;
-}
-
 int QGstreamerPlayerSession::volume() const
 {
     return m_volume;
@@ -699,7 +689,7 @@ void QGstreamerPlayerSession::finishVideoOutputChange()
                           );
 
 
-    GstState state;
+    GstState state = GST_STATE_VOID_PENDING;
 
     switch (m_pendingState) {
     case QMediaPlayer::StoppedState:
@@ -767,7 +757,7 @@ void QGstreamerPlayerSession::insertColorSpaceElement(GstElement *element, gpoin
     gst_bin_add(GST_BIN(session->m_videoOutputBin), session->m_colorSpace);
     gst_element_link_many(session->m_videoIdentity, session->m_colorSpace, session->m_videoSink, NULL);
 
-    GstState state;
+    GstState state = GST_STATE_VOID_PENDING;
 
     switch (session->m_pendingState) {
     case QMediaPlayer::StoppedState:
index 0b4041f..78f94c5 100644 (file)
@@ -93,10 +93,6 @@ public:
     qint64 duration() const;
     qint64 position() const;
 
-    bool isBuffering() const;
-
-    int bufferingProgress() const;
-
     int volume() const;
     bool isMuted() const;
 
@@ -161,7 +157,6 @@ signals:
     void mutedStateChanged(bool muted);
     void audioAvailableChanged(bool audioAvailable);
     void videoAvailableChanged(bool videoAvailable);
-    void bufferingChanged(bool buffering);
     void bufferingProgressChanged(int percentFilled);
     void playbackFinished();
     void tagsChanged();