From 5a7951ad80758c18f5b91edf0309924d759abb7e Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 13 Dec 2019 10:57:14 +0100 Subject: [PATCH] codecs: Report missing codecs to applications. [playback] Emit missing-plugin codec descriptions as QMediaPlayer::FormatErrors. JB#47099 Remove the old vague message on playback failure, as it's no longer needed. And a duplicated include. Change-Id: I0c515bd8e4de6d2e2c5966aa776219f5200353a9 --- .../gstreamer/mediaplayer/qgstreamerplayersession.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp index b269234b..8b0aaf1b 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include @@ -1309,13 +1310,15 @@ bool QGstreamerPlayerSession::processBusMessage(const QGstreamerMessage &message handlePlaybin2 = true; } + if (gst_is_missing_plugin_message(gm)) { + emit error(int(QMediaPlayer::FormatError), gst_missing_plugin_message_get_description(gm)); + } + if (handlePlaybin2) { if (GST_MESSAGE_TYPE(gm) == GST_MESSAGE_WARNING) { GError *err; gchar *debug; gst_message_parse_warning(gm, &err, &debug); - if (err->domain == GST_STREAM_ERROR && err->code == GST_STREAM_ERROR_CODEC_NOT_FOUND) - emit error(int(QMediaPlayer::FormatError), tr("Cannot play stream of type: ")); // GStreamer shows warning for HTTP playlists if (!m_isPlaylist) qWarning() << "Warning:" << QString::fromUtf8(err->message);