summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Smith <msmith@xiph.org>2008-03-12 12:39:13 +0000
committerMichael Smith <msmith@xiph.org>2008-03-12 12:39:13 +0000
commit15e209d20e6c342065d93270e7915333d62275df (patch)
tree4652d628364f6662d2ed3ceceee742270fbb3dcc
parent7b2c2c2ddaca0d996af25b35d0404385661258a5 (diff)
downloadgstreamer-plugins-base-15e209d20e6c342065d93270e7915333d62275df.tar.gz
gst-libs/gst/audio/gstringbuffer.*: Rename recently added buffer types to make more sense.
Original commit message from CVS: * gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_parse_caps): * gst-libs/gst/audio/gstringbuffer.h: Rename recently added buffer types to make more sense. * ext/alsa/gstalsasink.c: (alsasink_parse_spec), (gst_alsasink_write): Adapt for above API changes. Fixes bug #520523.
-rw-r--r--ChangeLog10
-rw-r--r--ext/alsa/gstalsasink.c11
-rw-r--r--gst-libs/gst/audio/gstringbuffer.c4
-rw-r--r--gst-libs/gst/audio/gstringbuffer.h12
4 files changed, 25 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ea4fc98b..7f096befb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-03-12 Michael Smith <msmith@fluendo.com>
+
+ * gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_parse_caps):
+ * gst-libs/gst/audio/gstringbuffer.h:
+ Rename recently added buffer types to make more sense.
+ * ext/alsa/gstalsasink.c: (alsasink_parse_spec),
+ (gst_alsasink_write):
+ Adapt for above API changes.
+ Fixes bug #520523.
+
2008-03-11 Sebastian Dröge <slomo@circular-chaos.org>
* win32/common/libgstnetbuffer.def:
diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c
index 63c4e7fbd..291fea78e 100644
--- a/ext/alsa/gstalsasink.c
+++ b/ext/alsa/gstalsasink.c
@@ -645,12 +645,9 @@ alsasink_parse_spec (GstAlsaSink * alsa, GstRingBufferSpec * spec)
case GST_BUFTYPE_MU_LAW:
alsa->format = SND_PCM_FORMAT_MU_LAW;
break;
- case GST_BUFTYPE_NONLINEAR:
+ case GST_BUFTYPE_IEC958:
alsa->format = SND_PCM_FORMAT_S16_BE;
- if (G_LIKELY (spec->format == GST_IEC958))
- alsa->iec958 = TRUE;
- else
- goto error;
+ alsa->iec958 = TRUE;
break;
default:
goto error;
@@ -888,8 +885,8 @@ gst_alsasink_write (GstAudioSink * asink, gpointer data, guint length)
guint i;
GST_DEBUG_OBJECT (asink, "swapping bytes");
- for (i = 0; i < length; i += 2) {
- ptr[i / 2] = GUINT16_SWAP_LE_BE (ptr[i / 2]);
+ for (i = 0; i < length / 2; i++) {
+ ptr[i] = GUINT16_SWAP_LE_BE (ptr[i]);
}
}
diff --git a/gst-libs/gst/audio/gstringbuffer.c b/gst-libs/gst/audio/gstringbuffer.c
index da0479b06..caf9579f5 100644
--- a/gst-libs/gst/audio/gstringbuffer.c
+++ b/gst-libs/gst/audio/gstringbuffer.c
@@ -380,7 +380,7 @@ gst_ring_buffer_parse_caps (GstRingBufferSpec * spec, GstCaps * caps)
if (!(gst_structure_get_int (structure, "rate", &spec->rate)))
goto parse_error;
- spec->type = GST_BUFTYPE_NONLINEAR;
+ spec->type = GST_BUFTYPE_IEC958;
spec->format = GST_IEC958;
spec->width = 16;
spec->depth = 16;
@@ -390,7 +390,7 @@ gst_ring_buffer_parse_caps (GstRingBufferSpec * spec, GstCaps * caps)
if (!(gst_structure_get_int (structure, "rate", &spec->rate)))
goto parse_error;
- spec->type = GST_BUFTYPE_NONLINEAR;
+ spec->type = GST_BUFTYPE_AC3;
spec->format = GST_AC3;
spec->width = 16;
spec->depth = 16;
diff --git a/gst-libs/gst/audio/gstringbuffer.h b/gst-libs/gst/audio/gstringbuffer.h
index a998de034..fa6dc72be 100644
--- a/gst-libs/gst/audio/gstringbuffer.h
+++ b/gst-libs/gst/audio/gstringbuffer.h
@@ -90,7 +90,10 @@ typedef enum {
* @GST_BUFTYPE_IMA_ADPCM: samples in ima adpcm
* @GST_BUFTYPE_MPEG: samples in mpeg audio format
* @GST_BUFTYPE_GSM: samples in gsm format
- * @GST_BUFTYPE_NONLINEAR: samples in non linear format (ac3, ec3, dts, ...)
+ * @GST_BUFTYPE_IEC958: samples in IEC958 frames (e.g. AC3)
+ * @GST_BUFTYPE_AC3: samples in AC3 format
+ * @GST_BUFTYPE_EAC3: samples in EAC3 format
+ * @GST_BUFTYPE_DTS: samples in DTS format
*
* The format of the samples in the ringbuffer.
*/
@@ -103,7 +106,10 @@ typedef enum
GST_BUFTYPE_IMA_ADPCM,
GST_BUFTYPE_MPEG,
GST_BUFTYPE_GSM,
- GST_BUFTYPE_NONLINEAR
+ GST_BUFTYPE_IEC958,
+ GST_BUFTYPE_AC3,
+ GST_BUFTYPE_EAC3,
+ GST_BUFTYPE_DTS
} GstBufferFormatType;
typedef enum
@@ -154,7 +160,7 @@ typedef enum
GST_GSM,
GST_IEC958,
GST_AC3,
- GST_EC3,
+ GST_EAC3,
GST_DTS
} GstBufferFormat;