Commit 3fc79474 authored by Monty Montgomery's avatar Monty Montgomery Committed by conrad

oggz-sort: fix handling of stream end

oggz-sort would miss an input on an iteration in which a stream ends and is
removed from the stream table.
parent 631d1121
......@@ -334,11 +334,14 @@ oggz_sort (OSData * osdata, FILE * outfile)
if (osdata->verbose)
printf ("Moo\n");
}
} else if (osdata->verbose) {
} else {
if (input == NULL) {
printf ("*** index %d NULL\n", i);
if (osdata->verbose)
printf ("*** index %d NULL, removing\n", i);
i--;
} else {
printf ("*** No page from index %d\n", i);
if (osdata->verbose)
printf ("*** No page from index %d\n", i);
}
}
}
......@@ -351,6 +354,7 @@ oggz_sort (OSData * osdata, FILE * outfile)
if (min_i != -1) {
input = (OSInput *) oggz_table_nth (osdata->inputs, min_i, &key);
og = input->og;
checked_fwrite (og->header, 1, og->header_len, outfile);
checked_fwrite (og->body, 1, og->body_len, outfile);
......
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