{
static const GstFormat formats[] = {
GST_FORMAT_TIME,
- GST_FORMAT_UNITS,
+ GST_FORMAT_DEFAULT,
GST_FORMAT_BYTES,
0
};
{
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;
}
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;
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:
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);
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;