Commit 2d237192 authored by conrad's avatar conrad

add oggz_set_metric_zero function, to mark header streams more cleanly


git-svn-id: http://svn.annodex.net/liboggz/trunk@712 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent b9cc1298
......@@ -190,6 +190,20 @@
* \{
*/
/**
* Specify that a logical bitstream has a constant zero metric. This is used
* for header bitstreams and signifies that all packets are always at unit 0.
* \param oggz An OGGZ handle
* \param serialno Identify the logical bitstream in \a oggz to attach
* this linear metric to. A value of -1 indicates that the metric should
* be attached to all unattached logical bitstreams in \a oggz.
* \returns 0 Success
* \retval OGGZ_ERR_BAD_SERIALNO \a serialno does not identify an existing
* logical bitstream in \a oggz.
* \retval OGGZ_ERR_BAD_OGGZ \a oggz does not refer to an existing OGGZ
*/
int oggz_set_metric_zero (OGGZ * oggz, long serialno);
/**
* Specify that a logical bitstream has a linear metric
* \param oggz An OGGZ handle
......
......@@ -451,6 +451,12 @@ oggz_set_metric_linear (OGGZ * oggz, long serialno,
linear_data, 1);
}
int
oggz_set_metric_zero (OGGZ * oggz, long serialno)
{
return oggz_set_metric_linear (oggz, serialno, 0, 1);
}
/*
* Check if a stream in an oggz has a metric
*/
......
......@@ -199,8 +199,8 @@ auto_annodex (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
if (strncmp ((char *)header, "Annodex", 8)) return 0;
if (!op->b_o_s) return 0;
/* Yeah ... set it up with a "linear" metric with numerator 0 :) */
oggz_set_metric_linear (oggz, serialno, 0, 1);
/* Apply a zero metric */
oggz_set_metric_zero (oggz, serialno);
return 1;
}
......@@ -292,7 +292,7 @@ auto_fishead (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
if (content != OGGZ_CONTENT_SKELETON) return 0;
/* Finished processing the skeleton; apply a zero metric */
oggz_set_metric_linear (oggz, serialno, 0, 1);
oggz_set_metric_zero (oggz, serialno);
}
return 1;
......
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