Commit 27465ac6 authored by conrad's avatar conrad

update tests, tools, examples for oggz_packet API

parent 8fda79df
......@@ -68,13 +68,13 @@ read_comments (OGGZ * oggz, long serialno)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
if (previous_b_o_s) {
read_comments (oggz, serialno);
}
previous_b_o_s = op->b_o_s;
previous_b_o_s = zp->op.b_o_s;
return 0;
}
......
......@@ -42,8 +42,9 @@ static int flush_next = 0;
#endif
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
OGGZ * writer = (OGGZ *)user_data;
int flush;
int ret;
......
......@@ -60,8 +60,9 @@ read_page (OGGZ * oggz, const ogg_page * og, long serialno, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
MHData * mhdata = (MHData *)user_data;
int flush;
int ret;
......
......@@ -60,8 +60,9 @@ print_granulepos (ogg_int64_t granulepos, int granuleshift)
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
int granuleshift;
granuleshift = oggz_get_granuleshift (oggz, serialno);
......
......@@ -45,8 +45,10 @@
static int got_an_eos = 0;
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
#if 0
if (got_an_eos) {
printf ("[%010lu]\t%ld bytes\tgranulepos %ld\n", serialno, op->bytes,
......
......@@ -94,8 +94,9 @@ hungry (OGGZ * oggz, int empty, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
static long packet_bytes_r = 1;
static int iter = 0;
static long b_o_s = 1;
......
......@@ -79,8 +79,9 @@ hungry (OGGZ * oggz, int empty, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
static int iter = 0;
static long b_o_s = 1;
static long e_o_s = 0;
......
......@@ -77,8 +77,9 @@ hungry (OGGZ * oggz, int empty, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
static int iter = 0;
static long b_o_s = 1;
static long e_o_s = 0;
......
......@@ -106,8 +106,9 @@ hungry (OGGZ * oggz, int empty, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
static int iter = 0;
static long b_o_s = 1;
static long e_o_s = 0;
......
......@@ -81,8 +81,9 @@ hungry (OGGZ * oggz, int empty, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
static int iter = 0;
static long b_o_s = 1;
static long e_o_s = 0;
......
......@@ -96,8 +96,10 @@ read_page (OGGZ * oggz, const ogg_page * og, long serialno, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
if (newpage != 1) FAIL ("Packet is not the first on a new page");
newpage = 0;
......
......@@ -77,8 +77,9 @@ hungry (OGGZ * oggz, int empty, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
static int iter = 0;
static long b_o_s = 1;
static long e_o_s = 0;
......
......@@ -70,8 +70,9 @@ hungry (OGGZ * oggz, int empty, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
static int iter = 0;
static long b_o_s = 1;
static long e_o_s = 0;
......
......@@ -79,8 +79,9 @@ hungry (OGGZ * oggz, int empty, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
static int iter = 0;
static long b_o_s = 1;
static long e_o_s = 0;
......
......@@ -77,8 +77,9 @@ hungry (OGGZ * oggz, int empty, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
static int iter = 0;
static long b_o_s = 1;
static long e_o_s = 0;
......
......@@ -50,8 +50,9 @@ static int has_skeleton = 0;
static int verbose = 0;
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
unsigned char * header = op->packet;
if (op->b_o_s) {
......
......@@ -265,9 +265,10 @@ read_page (OGGZ * oggz, const ogg_page * og, long serialno, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
OCData * ocdata = (OCData *)user_data;
ogg_packet * op = &zp->op;
const char * vendor;
int flush;
int ret;
......@@ -365,9 +366,10 @@ edit_comments (OCData * ocdata, char * outfilename)
}
static int
read_comments(OGGZ *oggz, ogg_packet *op, long serialno, void *user_data)
read_comments(OGGZ *oggz, oggz_packet * zp, long serialno, void *user_data)
{
OCData * ocdata = (OCData *)user_data;
ogg_packet * op = &zp->op;
const OggzComment * comment;
const char * codec_name;
......
......@@ -254,9 +254,10 @@ bin_dump (unsigned char * buf, long n, int dump_char)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ODData * oddata = (ODData *) user_data;
ogg_packet * op = &zp->op;
ogg_int64_t units;
double time_offset;
ogg_int64_t calced_gp = oggz_tell_granulepos (oggz);
......@@ -342,10 +343,12 @@ filter_page (OGGZ * oggz, const ogg_page * og, long serialno, void * user_data)
}
static int
read_new_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_new_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
ogg_packet * op = &zp->op;
if (op->b_o_s) {
read_packet (oggz, op, serialno, user_data);
read_packet (oggz, zp, serialno, user_data);
return OGGZ_CONTINUE;
} else {
return OGGZ_STOP_OK;
......
......@@ -458,10 +458,11 @@ read_page_pass2 (OGGZ * oggz, const ogg_page * og, long serialno, void * user_da
}
static int
read_packet_pass1 (OGGZ * oggz, ogg_packet * op, long serialno,
read_packet_pass1 (OGGZ * oggz, oggz_packet * zp, long serialno,
void * user_data)
{
OI_Info * info = (OI_Info *)user_data;
ogg_packet * op = &zp->op;
OI_TrackInfo * oit;
oit = oggz_table_lookup (info->tracks, serialno);
......@@ -499,10 +500,11 @@ read_packet_pass1 (OGGZ * oggz, ogg_packet * op, long serialno,
}
static int
read_packet_pass2 (OGGZ * oggz, ogg_packet * op, long serialno,
read_packet_pass2 (OGGZ * oggz, oggz_packet * zp, long serialno,
void * user_data)
{
OI_Info * info = (OI_Info *)user_data;
ogg_packet * op = &zp->op;
OI_TrackInfo * oit;
long deviation;
......
......@@ -122,9 +122,10 @@ filter_page (OGGZ * oggz, const ogg_page * og, long serialno, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
OSData * osdata = (OSData *) user_data;
ogg_packet * op = &zp->op;
double time_offset;
/* calculate granuleshift for theora track */
......
......@@ -354,9 +354,10 @@ read_page (OGGZ * oggz, const ogg_page * og, long serialno, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
OVData * ovdata = (OVData *)user_data;
ogg_packet * op = &zp->op;
timestamp_t timestamp;
int flush;
int ret = 0, feed_err = 0, i;
......
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