Commit 38338afd authored by conrad's avatar conrad

added oggz_tell_units interface


git-svn-id: http://svn.annodex.net/liboggz/trunk@383 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 967088ac
......@@ -952,6 +952,15 @@ typedef ogg_int64_t (*OggzMetric) (OGGZ * oggz, long serialno,
int oggz_set_metric (OGGZ * oggz, long serialno, OggzMetric metric,
void * user_data);
/**
* Query the current offset in units corresponding to the Metric function
* \param oggz An OGGZ handle
* \returns the offset in units
* \retval OGGZ_ERR_BAD_OGGZ \a oggz does not refer to an existing OGGZ
* \retval OGGZ_ERR_INVALID Operation not suitable for this OGGZ
*/
ogg_int64_t oggz_tell_units (OGGZ * oggz);
/**
* Seek to a number of units corresponding to the Metric function
* \param oggz An OGGZ handle
......
......@@ -28,6 +28,7 @@
oggz_set_metric_linear;
oggz_seek_units;
oggz_tell;
oggz_tell_units;
oggz_seek;
oggz_set_data_start;
oggz_serialno_new;
......
......@@ -192,6 +192,26 @@ oggz_tell (OGGZ * oggz)
return oggz->offset;
}
ogg_int64_t
oggz_tell_units (OGGZ * oggz)
{
OggzReader * reader;
if (oggz == NULL) return OGGZ_ERR_BAD_OGGZ;
if (oggz->flags & OGGZ_WRITE) {
return OGGZ_ERR_INVALID;
}
reader = &oggz->x.reader;
if (OGGZ_CONFIG_READ) {
return reader->current_unit;
} else {
return OGGZ_ERR_DISABLED;
}
}
/******** oggz_stream management ********/
static int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment