Commit a96f5333 authored by conrad's avatar conrad

Merge branch '1.0-stable'

Adapted fix for regression introduced in 8c2da1
parents ca65c376 ccd2a2fe
......@@ -301,6 +301,7 @@ oggz_read_deliver_packet(void *elem) {
OggzBufferedPacket *p = (OggzBufferedPacket *)elem;
ogg_int64_t gp_stored;
ogg_int64_t unit_stored;
int cb_ret;
if (p->zp.pos.calc_granulepos == -1) {
return DLIST_ITER_CANCEL;
......@@ -315,14 +316,18 @@ oggz_read_deliver_packet(void *elem) {
oggz_get_unit (p->oggz, p->serialno, p->zp.pos.calc_granulepos);
if (p->stream->read_packet) {
if (p->stream->read_packet(p->oggz, &(p->zp), p->serialno,
p->stream->read_user_data) != 0) {
return DLIST_ITER_ERROR;
if ((cb_ret = p->stream->read_packet(p->oggz, &(p->zp), p->serialno,
p->stream->read_user_data)) != 0) {
p->oggz->cb_next = cb_ret;
if (cb_ret == -1)
return DLIST_ITER_ERROR;
}
} else if (p->reader->read_packet) {
if (p->reader->read_packet(p->oggz, &(p->zp), p->serialno,
p->reader->read_user_data) != 0) {
return DLIST_ITER_ERROR;
if ((cb_ret = p->reader->read_packet(p->oggz, &(p->zp), p->serialno,
p->reader->read_user_data)) != 0) {
p->oggz->cb_next = cb_ret;
if (cb_ret == -1)
return DLIST_ITER_ERROR;
}
}
......@@ -479,9 +484,16 @@ oggz_read_sync (OGGZ * oggz)
ogg_int64_t gp_stored = stream->last_granulepos;
stream->last_packet = op;
oggz_dlist_reverse_iter(oggz->packet_buffer, oggz_read_update_gp);
oggz->cb_next = 0;
if (oggz_dlist_deliter(oggz->packet_buffer, oggz_read_deliver_packet) == -1) {
return OGGZ_ERR_HOLE_IN_DATA;
return OGGZ_ERR_HOLE_IN_DATA;
}
if (oggz->cb_next > 0) {
cb_ret = oggz->cb_next;
oggz->cb_next = 0;
continue;
}
oggz->cb_next = 0;
/* Fix up the stream granulepos. */
stream->last_granulepos = gp_stored;
......
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