summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2008-01-11 21:08:59 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2008-01-11 21:08:59 +0000
commitc2dddd0201c8eafb89219defe186904a5c4ee102 (patch)
treec229ad723125453b16ca3d3a5ce3c3277902fce6
parenta206c7bd3e2e3a99048d626308c482db1db6f627 (diff)
Generate the image-type values correctly. Leave them out of the caps when outputting a "preview image" tag, since it ...
Original commit message from CVS: * ext/flac/gstflacdec.c: (gst_flac_extract_picture_buffer): * gst/id3demux/id3v2frames.c: (parse_picture_frame): Generate the image-type values correctly. Leave them out of the caps when outputting a "preview image" tag, since it only makes sense to have one of those - the type is irrelevant. * sys/sunaudio/gstsunaudiomixerctrl.c: (gst_sunaudiomixer_ctrl_open): If we can, mark the mixer multiple open when we use it, in case (for some reason) the process wants to open it again elsewhere.
-rw-r--r--ChangeLog13
-rw-r--r--ext/flac/gstflacdec.c31
-rw-r--r--gst/id3demux/id3v2frames.c23
-rw-r--r--sys/sunaudio/gstsunaudiomixerctrl.c3
4 files changed, 46 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index a86e6661..0252b15a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-01-11 Jan Schmidt <Jan.Schmidt@sun.com>
+
+ * ext/flac/gstflacdec.c: (gst_flac_extract_picture_buffer):
+ * gst/id3demux/id3v2frames.c: (parse_picture_frame):
+ Generate the image-type values correctly. Leave them out of the caps
+ when outputting a "preview image" tag, since it only makes sense
+ to have one of those - the type is irrelevant.
+
+ * sys/sunaudio/gstsunaudiomixerctrl.c:
+ (gst_sunaudiomixer_ctrl_open):
+ If we can, mark the mixer multiple open when we use it, in case
+ (for some reason) the process wants to open it again elsewhere.
+
2008-01-11 Wim Taymans <wim.taymans@collabora.co.uk>
Patch by: Olivier Crete <tester at tester dot ca>
diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c
index c21caa4a..fd4126a7 100644
--- a/ext/flac/gstflacdec.c
+++ b/ext/flac/gstflacdec.c
@@ -663,28 +663,27 @@ gst_flac_extract_picture_buffer (GstFlacDec * flacdec,
g_free (mime_type);
if (image && image_caps) {
- GstTagList *tags;
- FLAC__StreamMetadata_Picture_Type pic_type = picture.type;
+ GstTagList *tags = gst_tag_list_new ();
- tags = gst_tag_list_new ();
-
- if (pic_type > 20) {
- pic_type = GST_TAG_IMAGE_TYPE_UNDEFINED;
- }
-
- gst_structure_set (gst_caps_get_structure (image_caps, 0),
- "image-type", GST_TYPE_TAG_IMAGE_TYPE,
- (GstTagImageType) pic_type, NULL);
-
- gst_buffer_set_caps (image, image_caps);
- gst_caps_unref (image_caps);
- if (pic_type == 1 || pic_type == 2) {
- /* file icon of some sort */
+ if (picture.type == 1 || picture.type == 2) {
+ /* file icon for preview. Don't add image-type to caps, since it only
+ * makes sense for there to be one of these. */
+ gst_buffer_set_caps (image, image_caps);
gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
GST_TAG_PREVIEW_IMAGE, image, NULL);
} else {
+ GstTagImageType gst_tag_pic_type = GST_TAG_IMAGE_TYPE_UNDEFINED;
+
+ if (picture.type >= 0x03 && picture.type <= 0x14)
+ gst_tag_pic_type = (GstTagImageType) ((gint) (picture.type) - 2);
+
+ gst_structure_set (gst_caps_get_structure (image_caps, 0),
+ "image-type", GST_TYPE_TAG_IMAGE_TYPE, gst_tag_pic_type, NULL);
+
+ gst_buffer_set_caps (image, image_caps);
gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_IMAGE, image, NULL);
}
+ gst_caps_unref (image_caps);
gst_buffer_unref (image);
/* Announce discovered tags */
diff --git a/gst/id3demux/id3v2frames.c b/gst/id3demux/id3v2frames.c
index ec06dd24..0d0944ed 100644
--- a/gst/id3demux/id3v2frames.c
+++ b/gst/id3demux/id3v2frames.c
@@ -616,22 +616,29 @@ parse_picture_frame (ID3TagsWorking * work)
}
if (image && image_caps) {
- if (pic_type > 0x14)
- pic_type = GST_TAG_IMAGE_TYPE_UNDEFINED;
- gst_structure_set (gst_caps_get_structure (image_caps, 0),
- "image-type", GST_TYPE_TAG_IMAGE_TYPE,
- (GstTagImageType) pic_type, NULL);
- gst_buffer_set_caps (image, image_caps);
- gst_caps_unref (image_caps);
if (pic_type == 0x01 || pic_type == 0x02) {
- /* file icon of some sort */
+ /* file icon for preview. Don't add image-type to caps, since there
+ * is only supposed to be one of these. */
+ gst_buffer_set_caps (image, image_caps);
gst_tag_list_add (work->tags, GST_TAG_MERGE_APPEND,
GST_TAG_PREVIEW_IMAGE, image, NULL);
} else {
+ GstTagImageType gst_tag_pic_type = GST_TAG_IMAGE_TYPE_UNDEFINED;
+
+ /* Remap the ID3v2 APIC type our ImageType enum */
+ if (pic_type >= 0x3 && pic_type <= 0x14)
+ gst_tag_pic_type = (GstTagImageType) (pic_type - 2);
+
+ gst_structure_set (gst_caps_get_structure (image_caps, 0),
+ "image-type", GST_TYPE_TAG_IMAGE_TYPE, gst_tag_pic_type, NULL);
+
+ gst_buffer_set_caps (image, image_caps);
gst_tag_list_add (work->tags, GST_TAG_MERGE_APPEND,
GST_TAG_IMAGE, image, NULL);
}
+
+ gst_caps_unref (image_caps);
gst_buffer_unref (image);
}
diff --git a/sys/sunaudio/gstsunaudiomixerctrl.c b/sys/sunaudio/gstsunaudiomixerctrl.c
index 067eb117..4a6244b6 100644
--- a/sys/sunaudio/gstsunaudiomixerctrl.c
+++ b/sys/sunaudio/gstsunaudiomixerctrl.c
@@ -29,6 +29,7 @@
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
+#include <sys/mixer.h>
#include <gst/gst-i18n-plugin.h>
@@ -60,6 +61,8 @@ gst_sunaudiomixer_ctrl_open (GstSunAudioMixerCtrl * mixer)
return FALSE;
}
+ /* Try to set the multiple open flag if we can, but ignore errors */
+ ioctl (mixer->mixer_fd, AUDIO_MIXER_MULTIPLE_OPEN);
mixer->mixer_fd = fd;
return TRUE;