}
break;
}
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
if (ivorbisfile->seek_accurate) {
if (ov_pcm_seek (&ivorbisfile->vf, ivorbisfile->seek_value) == 0) {
ivorbisfile->need_discont = TRUE;
samples = (gint64) (ov_pcm_tell (&ivorbisfile->vf));
discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME, time,
- GST_FORMAT_UNITS, samples, NULL);
+ GST_FORMAT_DEFAULT, samples, NULL);
gst_pad_push (ivorbisfile->srcpad, GST_BUFFER (discont));
}
static GstFormat src_formats[] = {
GST_FORMAT_TIME,
GST_FORMAT_BYTES,
- GST_FORMAT_UNITS,
+ GST_FORMAT_DEFAULT,
0,
0
};
ivorbisfile = GST_IVORBISFILE (gst_pad_get_parent (pad));
- if (*dest_format == GST_FORMAT_DEFAULT)
- *dest_format = GST_FORMAT_TIME;
-
vi = ov_info (&ivorbisfile->vf, -1);
bytes_per_sample = vi->channels * 2;
switch (src_format) {
case GST_FORMAT_BYTES:
switch (*dest_format) {
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
*dest_value = src_value / (vi->channels * 2);
break;
case GST_FORMAT_TIME:
default:
res = FALSE;
}
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
switch (*dest_format) {
case GST_FORMAT_BYTES:
*dest_value = src_value * bytes_per_sample;
switch (*dest_format) {
case GST_FORMAT_BYTES:
scale = bytes_per_sample;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
*dest_value = src_value * scale * vi->rate / GST_SECOND;
break;
default:
case GST_FORMAT_BYTES:
res = FALSE;
break;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
if (src_value > ivorbisfile->vf.links) {
src_value = ivorbisfile->vf.links;
}
ivorbisfile = GST_IVORBISFILE (gst_pad_get_parent (pad));
- if (*dest_format == GST_FORMAT_DEFAULT)
- *dest_format = GST_FORMAT_TIME;
-
switch (src_format) {
case GST_FORMAT_BYTES:
switch (*dest_format) {
case GST_QUERY_TOTAL:
{
switch (*format) {
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
if (ivorbisfile->vf.seekable)
*value = ov_pcm_total (&ivorbisfile->vf, -1);
else
else
return FALSE;
break;
- case GST_FORMAT_DEFAULT:
- *format = GST_FORMAT_TIME;
- /* fall through */
case GST_FORMAT_TIME:
if (ivorbisfile->vf.seekable)
*value = (gint64) (ov_time_total (&ivorbisfile->vf, -1) * GST_SECOND);
}
case GST_QUERY_POSITION:
switch (*format) {
- case GST_FORMAT_DEFAULT:
- *format = GST_FORMAT_TIME;
- /* fall through */
case GST_FORMAT_TIME:
if (ivorbisfile->vf.seekable)
*value = (gint64) (ov_time_tell (&ivorbisfile->vf) * GST_SECOND);
else
*value = ivorbisfile->total_bytes;
break;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
if (ivorbisfile->vf.seekable)
*value = ov_pcm_tell (&ivorbisfile->vf);
else
}
offset /= vi->channels * 2;
/* fallthrough */
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
ivorbisfile->seek_pending = TRUE;
ivorbisfile->seek_value = offset;
ivorbisfile->seek_format = format;
switch (src_format) {
case GST_FORMAT_BYTES:
switch (*dest_format) {
- case GST_FORMAT_DEFAULT:
- *dest_format = GST_FORMAT_TIME;
case GST_FORMAT_TIME:
default:
res = FALSE;
break;
case GST_FORMAT_TIME:
switch (*dest_format) {
- case GST_FORMAT_DEFAULT:
- *dest_format = GST_FORMAT_BYTES;
case GST_FORMAT_BYTES:
default:
res = FALSE;
switch (src_format) {
case GST_FORMAT_BYTES:
switch (*dest_format) {
- case GST_FORMAT_DEFAULT:
- *dest_format = GST_FORMAT_TIME;
case GST_FORMAT_TIME:
default:
res = FALSE;
break;
case GST_FORMAT_TIME:
switch (*dest_format) {
- case GST_FORMAT_DEFAULT:
- *dest_format = GST_FORMAT_BYTES;
case GST_FORMAT_BYTES:
*dest_value = src_value * 6 * (swfdec->width * swfdec->height >> 2) *
video_rates[swfdec->decoder->frame_rate_code] / GST_SECOND;
break;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
*dest_value = src_value * video_rates[swfdec->decoder->frame_rate_code] / GST_SECOND;
break;
default:
res = FALSE;
}
break;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
switch (*dest_format) {
- case GST_FORMAT_DEFAULT:
- *dest_format = GST_FORMAT_TIME;
case GST_FORMAT_TIME:
if (video_rates[swfdec->decoder->frame_rate_code] != 0.0) {
*dest_value = src_value * GST_SECOND /
case GST_FORMAT_BYTES:
*dest_value = src_value * 6 * (swfdec->width * swfdec->height >> 2);
break;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
*dest_value = src_value;
break;
default:
case GST_QUERY_TOTAL:
{
switch (*format) {
- case GST_FORMAT_DEFAULT:
- *format = GST_FORMAT_TIME;
- /* fallthrough */
case GST_FORMAT_TIME:
{
int n_frames;
case GST_QUERY_POSITION:
{
switch (*format) {
- case GST_FORMAT_DEFAULT:
- *format = GST_FORMAT_TIME;
- /* fallthrough */
default:
res = FALSE;
break;