From f460018c842e91f2831245977f6712818bc813cf Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 28 May 2003 06:25:39 +0000 Subject: [PATCH] GST_FORMAT_UNITS -> GST_FORMAT_DEFAULT conversion Original commit message from CVS: GST_FORMAT_UNITS -> GST_FORMAT_DEFAULT conversion --- common | 2 +- ext/alsa/gstalsa.c | 19 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/common b/common index 54aa761f9d..9a3a505fcc 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 54aa761f9d486bca3ee35029a110386a144340c5 +Subproject commit 9a3a505fcc52865de0bedbb3ee1ce0a6dcc9a025 diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index a8e12bc781..6238b2c893 100644 --- a/ext/alsa/gstalsa.c +++ b/ext/alsa/gstalsa.c @@ -1678,7 +1678,7 @@ gst_alsa_get_formats (GstPad *pad) { static const GstFormat formats[] = { GST_FORMAT_TIME, - GST_FORMAT_UNITS, + GST_FORMAT_DEFAULT, GST_FORMAT_BYTES, 0 }; @@ -1696,8 +1696,7 @@ gst_alsa_convert (GstAlsa *this, GstFormat src_format, gint64 src_value, { gboolean res = TRUE; - if (src_format == *dest_format || (src_format == GST_FORMAT_UNITS && *dest_format == GST_FORMAT_DEFAULT)) { - *dest_format = GST_FORMAT_UNITS; + if (src_format == *dest_format) { *dest_value = src_value; return TRUE; } @@ -1708,13 +1707,11 @@ gst_alsa_convert (GstAlsa *this, GstFormat src_format, gint64 src_value, case GST_FORMAT_BYTES: switch (*dest_format) { case GST_FORMAT_DEFAULT: - *dest_format = GST_FORMAT_UNITS; + *dest_value = gst_alsa_bytes_to_samples (this, (guint) src_value); + break; case GST_FORMAT_TIME: *dest_value = gst_alsa_bytes_to_timestamp (this, (guint) src_value); break; - case GST_FORMAT_UNITS: - *dest_value = gst_alsa_samples_to_timestamp (this, (guint) src_value); - break; default: res = FALSE; break; @@ -1723,8 +1720,6 @@ gst_alsa_convert (GstAlsa *this, GstFormat src_format, gint64 src_value, case GST_FORMAT_TIME: switch (*dest_format) { case GST_FORMAT_DEFAULT: - *dest_format = GST_FORMAT_UNITS; - case GST_FORMAT_UNITS: *dest_value = gst_alsa_timestamp_to_samples (this, (GstClockTime) src_value); break; case GST_FORMAT_BYTES: @@ -1735,7 +1730,7 @@ gst_alsa_convert (GstAlsa *this, GstFormat src_format, gint64 src_value, break; } break; - case GST_FORMAT_UNITS: + case GST_FORMAT_DEFAULT: switch (*dest_format) { case GST_FORMAT_TIME: *dest_value = gst_alsa_samples_to_timestamp (this, (guint) src_value); @@ -1777,11 +1772,11 @@ gst_alsa_query_func (GstElement *element, GstQueryType type, GstFormat *format, case GST_QUERY_LATENCY: { snd_pcm_sframes_t delay; ERROR_CHECK (snd_pcm_delay (this->handle, &delay), "Error getting delay: %s"); - res = gst_alsa_convert (this, GST_FORMAT_UNITS, (gint64) delay, format, value); + res = gst_alsa_convert (this, GST_FORMAT_DEFAULT, (gint64) delay, format, value); break; } case GST_QUERY_POSITION: - res = gst_alsa_convert (this, GST_FORMAT_UNITS, this->transmitted, format, value); + res = gst_alsa_convert (this, GST_FORMAT_DEFAULT, this->transmitted, format, value); break; default: break;