Handle more errors from GStreamer.

Corrupted etc files can throw GST_STREAM_ERROR_DECODE and those should
generally stop playback.  So now any error is fatal, not just the
recognised ones.

Change-Id: I7b6dd2a460d94f70c459a313a9d4dc84028f8002
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
This commit is contained in:
Michael Goddard
2012-03-15 15:41:19 +10:00
committed by Qt by Nokia
parent 1f1bdbec82
commit 1a1ac6b884
2 changed files with 11 additions and 11 deletions

View File

@@ -262,13 +262,12 @@ bool QGstreamerAudioDecoderSession::processBusMessage(const QGstreamerMessage &m
GError *err;
gchar *debug;
gst_message_parse_error(gm, &err, &debug);
// If the source has given up, so do we.
if (qstrcmp(GST_OBJECT_NAME(GST_MESSAGE_SRC(gm)), "source") == 0) {
processInvalidMedia(QAudioDecoder::ResourceError, QString::fromUtf8(err->message));
} else if (err->domain == GST_STREAM_ERROR
QAudioDecoder::Error qerror = QAudioDecoder::ResourceError;
if (err->domain == GST_STREAM_ERROR
&& (err->code == GST_STREAM_ERROR_DECRYPT || err->code == GST_STREAM_ERROR_DECRYPT_NOKEY)) {
processInvalidMedia(QAudioDecoder::AccessDeniedError, QString::fromUtf8(err->message));
qerror = QAudioDecoder::AccessDeniedError;
}
processInvalidMedia(qerror, QString::fromUtf8(err->message));
g_error_free(err);
g_free(debug);
}