Summary: | [PATCH] Not all available mime types are listed due to ignoring all but the first caps-struct | ||
---|---|---|---|
Product: | [Unmaintained] phonon-backend-gstreamer | Reporter: | Shlomi Fish <shlomif> |
Component: | general | Assignee: | Matthias Kretz <kretz> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | martin.sandsmark, myriam |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Mandriva RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.4.1 | |
Sentry Crash Report: | |||
Attachments: | Patch to correct the problem. |
Description
Shlomi Fish
2010-03-18 22:48:56 UTC
Created attachment 41749 [details]
Patch to correct the problem.
This is a patch that corrects the problem. I hereby disclaim any ownership on it and licences it under public-domain / CC-Zero.
commit 97555adfca6830c23682f03eba72b8b44ec38f28 Author: Colin Guthrie <cguthrie@mandriva.org> Date: Sat Mar 20 11:57:25 2010 +0000 gstreamer: Include all supported mime types. Shlomi Fish discovered that not all mime types supported by the gstreamer backend were parsed into Phonon. This change ensures that that all mime types are parsed correctly. Thanks to Shlomi for the patch. BUG: 231254 diff --git a/gstreamer/backend.cpp b/gstreamer/backend.cpp index 3a794b0..729a1d3 100644 --- a/gstreamer/backend.cpp +++ b/gstreamer/backend.cpp @@ -240,10 +240,13 @@ QStringList Backend::availableMimeTypes() const GstCaps *caps = gst_static_pad_template_get_caps (padTemplate); if (caps) { - const GstStructure* capsStruct = gst_caps_get_structure (caps, 0); - QString mime = QString::fromUtf8(gst_structure_get_name (capsStruct)); - if (!availableMimeTypes.contains(mime)) - availableMimeTypes.append(mime); + for (unsigned int struct_idx = 0; struct_idx < gst_caps_get_size (caps); struct_idx++) { + + const GstStructure* capsStruct = gst_caps_get_structure (caps, struct_idx); + QString mime = QString::fromUtf8(gst_structure_get_name (capsStruct)); + if (!availableMimeTypes.contains(mime)) + availableMimeTypes.append(mime); + } } } } reassigning to the new bugzilla product for better bug tracing of the various backends. Sorry for the noise. |