UNITS -> DEFAULT

Original commit message from CVS:
UNITS -> DEFAULT
This commit is contained in:
Wim Taymans 2003-05-24 10:41:58 +00:00
parent 26e26d1aa4
commit 9ba5e6cfe6
3 changed files with 5 additions and 15 deletions

View file

@ -476,13 +476,11 @@ gst_siddec_src_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
switch (src_format) { switch (src_format) {
case GST_FORMAT_BYTES: case GST_FORMAT_BYTES:
switch (*dest_format) { switch (*dest_format) {
case GST_FORMAT_UNITS: case GST_FORMAT_DEFAULT:
if (bytes_per_sample == 0) if (bytes_per_sample == 0)
return FALSE; return FALSE;
*dest_value = src_value / bytes_per_sample; *dest_value = src_value / bytes_per_sample;
break; break;
case GST_FORMAT_DEFAULT:
*dest_format = GST_FORMAT_TIME;
case GST_FORMAT_TIME: case GST_FORMAT_TIME:
{ {
gint byterate = bytes_per_sample * siddec->config->frequency; gint byterate = bytes_per_sample * siddec->config->frequency;
@ -496,13 +494,11 @@ gst_siddec_src_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
res = FALSE; res = FALSE;
} }
break; break;
case GST_FORMAT_UNITS: case GST_FORMAT_DEFAULT:
switch (*dest_format) { switch (*dest_format) {
case GST_FORMAT_BYTES: case GST_FORMAT_BYTES:
*dest_value = src_value * bytes_per_sample; *dest_value = src_value * bytes_per_sample;
break; break;
case GST_FORMAT_DEFAULT:
*dest_format = GST_FORMAT_TIME;
case GST_FORMAT_TIME: case GST_FORMAT_TIME:
if (siddec->config->frequency == 0) if (siddec->config->frequency == 0)
return FALSE; return FALSE;
@ -514,12 +510,10 @@ gst_siddec_src_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
break; break;
case GST_FORMAT_TIME: case GST_FORMAT_TIME:
switch (*dest_format) { switch (*dest_format) {
case GST_FORMAT_DEFAULT:
*dest_format = GST_FORMAT_BYTES;
case GST_FORMAT_BYTES: case GST_FORMAT_BYTES:
scale = bytes_per_sample; scale = bytes_per_sample;
/* fallthrough */ /* fallthrough */
case GST_FORMAT_UNITS: case GST_FORMAT_DEFAULT:
*dest_value = src_value * scale * siddec->config->frequency / GST_SECOND; *dest_value = src_value * scale * siddec->config->frequency / GST_SECOND;
break; break;
default: default:

View file

@ -27,7 +27,7 @@
gdouble gdouble
gst_video_frame_rate (GstPad *pad) gst_video_frame_rate (GstPad *pad)
{ {
GstFormat dest_format = GST_FORMAT_UNITS; GstFormat dest_format = GST_FORMAT_DEFAULT;
gint64 dest_value = 0; gint64 dest_value = 0;
gdouble fps; gdouble fps;

View file

@ -138,7 +138,7 @@ gst_monkeydec_get_formats (GstPad *pad)
{ {
static const GstFormat src_formats[] = { static const GstFormat src_formats[] = {
/* GST_FORMAT_BYTES, /* GST_FORMAT_BYTES,
GST_FORMAT_UNITS,*/ GST_FORMAT_DEFAULT,*/
GST_FORMAT_TIME, GST_FORMAT_TIME,
(GstFormat)0 (GstFormat)0
}; };
@ -177,8 +177,6 @@ gst_monkeydec_src_query (GstPad *pad, GstQueryType type,
switch (type) { switch (type) {
case GST_QUERY_TOTAL: case GST_QUERY_TOTAL:
switch (*format) { switch (*format) {
case GST_FORMAT_DEFAULT:
*format = GST_FORMAT_TIME;
case GST_FORMAT_TIME: case GST_FORMAT_TIME:
*value = monkeydec->decomp->GetInfo (APE_DECOMPRESS_LENGTH_MS) * 1000000LL; *value = monkeydec->decomp->GetInfo (APE_DECOMPRESS_LENGTH_MS) * 1000000LL;
break; break;
@ -189,8 +187,6 @@ gst_monkeydec_src_query (GstPad *pad, GstQueryType type,
break; break;
case GST_QUERY_POSITION: case GST_QUERY_POSITION:
switch (*format) { switch (*format) {
case GST_FORMAT_DEFAULT:
*format = GST_FORMAT_TIME;
default: default:
*value = monkeydec->decomp->GetInfo (APE_DECOMPRESS_CURRENT_MS) * 1000000LL; *value = monkeydec->decomp->GetInfo (APE_DECOMPRESS_CURRENT_MS) * 1000000LL;
break; break;