From 8f3496568181240599010dcadfb99c096930bb28 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 30 Mar 2004 06:51:31 +0000 Subject: [PATCH] ext/alsa/gstalsa.c: Don't fixate fields that aren't in the caps. Original commit message from CVS: * ext/alsa/gstalsa.c: (gst_alsa_fixate): Don't fixate fields that aren't in the caps. * gst/sine/gstsinesrc.c: change rate caps to [1,MAX] * gst/videocrop/gstvideocrop.c: (plugin_init): Change rank to NONE. --- ChangeLog | 7 +++++++ ext/alsa/gstalsa.c | 18 ++++++++++++------ gst/sine/gstsinesrc.c | 3 +-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc3240adac..b58e948f5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-03-29 David Schleef + + * ext/alsa/gstalsa.c: (gst_alsa_fixate): Don't fixate fields that + aren't in the caps. + * gst/sine/gstsinesrc.c: change rate caps to [1,MAX] + * gst/videocrop/gstvideocrop.c: (plugin_init): Change rank to NONE. + 2004-03-30 Benjamin Otte * gst-libs/gst/riff/riff-media.c: diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index 88b170f5e1..5780a51332 100644 --- a/ext/alsa/gstalsa.c +++ b/ext/alsa/gstalsa.c @@ -781,15 +781,21 @@ gst_alsa_fixate (GstPad * pad, const GstCaps * caps) if (gst_caps_structure_fixate_field_nearest_int (structure, "rate", 44100)) { return newcaps; } - if (gst_caps_structure_fixate_field_nearest_int (structure, "depth", 16)) { - return newcaps; - } - if (gst_caps_structure_fixate_field_nearest_int (structure, "width", 16)) { - return newcaps; - } if (gst_caps_structure_fixate_field_nearest_int (structure, "channels", 2)) { return newcaps; } + if (strcmp (gst_structure_get_name (structure), "audio/x-raw-int") == 0) { + if (gst_caps_structure_fixate_field_nearest_int (structure, "depth", 16)) { + return newcaps; + } + if (gst_caps_structure_fixate_field_nearest_int (structure, "width", 16)) { + return newcaps; + } + } else { + if (gst_caps_structure_fixate_field_nearest_int (structure, "width", 32)) { + return newcaps; + } + } gst_caps_free (newcaps); diff --git a/gst/sine/gstsinesrc.c b/gst/sine/gstsinesrc.c index 17ac7e1f77..668716c372 100644 --- a/gst/sine/gstsinesrc.c +++ b/gst/sine/gstsinesrc.c @@ -65,8 +65,7 @@ GST_STATIC_PAD_TEMPLATE ("src", "endianness = (int) BYTE_ORDER, " "signed = (boolean) true, " "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) [ 8000, 48000 ], " "channels = (int) 1") + "depth = (int) 16, " "rate = (int) [ 1, MAX ], " "channels = (int) 1") ); static void gst_sinesrc_class_init (GstSineSrcClass * klass);