[NUT-devel] [NUT] (ods15): r68 - /trunk/libnut/demuxer.c
syncmail at mplayerhq.hu
syncmail at mplayerhq.hu
Sat Feb 25 09:58:52 CET 2006
Author: ods15
Date: Sat Feb 25 09:58:52 2006
New Revision: 68
Log:
Invalidate stopper if it has a back_ptr different than found.
Modified:
trunk/libnut/demuxer.c
Modified: trunk/libnut/demuxer.c
==============================================================================
--- trunk/libnut/demuxer.c (original)
+++ trunk/libnut/demuxer.c Sat Feb 25 09:58:52 2006
@@ -996,17 +996,21 @@
// find closest syncpoint by linear search, SHOULD be one pointed by back_ptr...
CHECK(find_syncpoint(nut, 0, &s, 0));
clear_dts_cache(nut);
- nut->last_syncpoint = 0;
+ nut->last_syncpoint = 0; // last_key is invalid
seek_buf(nut->i, s.pos, SEEK_SET); // go back to syncpoint. This will not need a seek.
nut->seek_status = s.pos << 1;
if (s.pos > start + 7) goto err_out; // error condition, we didn't get the syncpoint we wanted
}
- if (stopper) for (i = 1; i < sl->len; i++) {
- if ((sl->s[i].pos >> 1) > (stopper->pos >> 1) - (stopper->back_ptr>>1) + 7) {
- if (sl->s[i-1].back_ptr & 1) stopper_syncpoint = sl->s[i].pos >> 1;
- break;
- }
+ if (stopper) {
+ off_t back_ptr = (stopper->pos >> 1) - (stopper->back_ptr>>1);
+ for (i = 1; i < sl->len; i++) {
+ if ((sl->s[i].pos >> 1) > back_ptr + 7) {
+ if (sl->s[i-1].back_ptr & 1) stopper_syncpoint = sl->s[i].pos >> 1;
+ break;
+ }
+ }
+ if (back_ptr > (nut->seek_status>>1)) stopper = NULL; // bad stopper, it points to a different back_ptr
}
if (!(nut->seek_status & 1)) while (bctello(nut->i) < end || !end) {
More information about the NUT-devel
mailing list