[nut]: r156 - trunk/libnut/demuxer.c

Author: ods15 Date: Sun Sep 24 16:18:27 2006 New Revision: 156 Modified: trunk/libnut/demuxer.c Log: modify get_packet to not recurse on its own but let the caller do it. makes saw_syncpoint more accurate. Modified: trunk/libnut/demuxer.c ============================================================================== --- trunk/libnut/demuxer.c (original) +++ trunk/libnut/demuxer.c Sun Sep 24 16:18:27 2006 @@ -540,7 +540,7 @@ CHECK(get_bytes(nut->i, 1, &tmp)); } else { CHECK(get_header(nut->i, NULL)); - return get_packet(nut, pd, saw_syncpoint); + return 3; } } @@ -697,7 +697,7 @@ nut->seek_status = 0; } - err = get_packet(nut, pd, NULL); + while ((err = get_packet(nut, pd, NULL)) == 3); if (err < 0) { // some error occured! fprintf(stderr, "NUT: %s\n", nut_error(-err)); // rewind as much as possible @@ -1046,8 +1046,11 @@ if (!(nut->seek_status & 1)) while (bctello(nut->i) < end || !end) { int saw_syncpoint; nut_packet_t pd; + buf_before = bctello(nut->i); - CHECK(get_packet(nut, &pd, &saw_syncpoint)); // FIXME we're counting on syncpoint cache!! for the good_key later, and stopper_syncpoint + err = get_packet(nut, &pd, &saw_syncpoint); // FIXME we're counting on syncpoint cache!! for the good_key later, and stopper_syncpoint + if (err == 3) continue; + CHECK(err); if (saw_syncpoint) { if (stopper && !stopper_syncpoint && buf_before > stopper->pos - stopper->back_ptr + 15) { @@ -1131,7 +1134,8 @@ while (bctello(nut->i) < min_pos) { nut_packet_t pd; - CHECK(get_packet(nut, &pd, NULL)); + while ((err = get_packet(nut, &pd, NULL)) == 3); + CHECK(err); push_frame(nut, &pd); CHECK(skip_buffer(nut->i, pd.len)); }
participants (1)
-
ods15