summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPiotr Srebrny <piotr.srebrny@qt.io>2022-12-02 13:51:17 +0100
committerPiotr Srebrny <piotr.srebrny@qt.io>2022-12-02 15:12:16 +0100
commitfe1ede7ce059c91404e348ee2cbbf70dc6f3afd2 (patch)
tree3a35ae72fd3d64f58a3a8c2c3130d50410952633 /src
parent13bc41272480e10a6dccab0bcffb673975464e55 (diff)
Remove unncessary checks as playbin is never null
QGstreamerAudioDecoder constructor receives not null playbin, thus it will never be null. Pick-to: 6.4 Change-Id: Idd1e8f0840cdc7736b3724f1706c76663ffa46c0 Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/multimedia/gstreamer/audio/qgstreameraudiodecoder.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/plugins/multimedia/gstreamer/audio/qgstreameraudiodecoder.cpp b/src/plugins/multimedia/gstreamer/audio/qgstreameraudiodecoder.cpp
index f793a4537..585bd10da 100644
--- a/src/plugins/multimedia/gstreamer/audio/qgstreameraudiodecoder.cpp
+++ b/src/plugins/multimedia/gstreamer/audio/qgstreameraudiodecoder.cpp
@@ -76,9 +76,6 @@ QGstreamerAudioDecoder::QGstreamerAudioDecoder(QGstPipeline playbin, QGstElement
QGstreamerAudioDecoder::~QGstreamerAudioDecoder()
{
- if (m_playbin.isNull())
- return;
-
stop();
#if QT_CONFIG(gstreamer_app)
@@ -275,11 +272,6 @@ void QGstreamerAudioDecoder::setSourceDevice(QIODevice *device)
void QGstreamerAudioDecoder::start()
{
- if (m_playbin.isNull()) {
- processInvalidMedia(QAudioDecoder::ResourceError, QLatin1String("Playbin element is not valid"));
- return;
- }
-
addAppSink();
if (!mSource.isEmpty()) {
@@ -328,9 +320,6 @@ void QGstreamerAudioDecoder::start()
void QGstreamerAudioDecoder::stop()
{
- if (m_playbin.isNull())
- return;
-
m_playbin.setState(GST_STATE_NULL);
removeAppSink();
@@ -457,9 +446,6 @@ GstFlowReturn QGstreamerAudioDecoder::new_sample(GstAppSink *, gpointer user_dat
void QGstreamerAudioDecoder::setAudioFlags(bool wantNativeAudio)
{
- if (m_playbin.isNull())
- return;
-
int flags = m_playbin.getInt("flags");
// make sure not to use GST_PLAY_FLAG_NATIVE_AUDIO unless desired
// it prevents audio format conversion
@@ -501,10 +487,7 @@ void QGstreamerAudioDecoder::removeAppSink()
void QGstreamerAudioDecoder::updateDuration()
{
- int duration = -1;
-
- if (!m_playbin.isNull())
- duration = m_playbin.duration() / 1000000;
+ int duration = m_playbin.duration() / 1000000;
if (m_duration != duration) {
m_duration = duration;