core: Update the stream offset after each tag is processed.
The `preload_offset` is only ever moved forward, of course.
This commit is contained in:
parent
3410d9fcf8
commit
3d5156b90d
|
@ -12,6 +12,7 @@ use flv_rs::{
|
||||||
use gc_arena::{Collect, GcCell, MutationContext};
|
use gc_arena::{Collect, GcCell, MutationContext};
|
||||||
use ruffle_video::VideoStreamHandle;
|
use ruffle_video::VideoStreamHandle;
|
||||||
use ruffle_wstr::WStr;
|
use ruffle_wstr::WStr;
|
||||||
|
use std::cmp::max;
|
||||||
use std::io::Seek;
|
use std::io::Seek;
|
||||||
use swf::{VideoCodec, VideoDeblocking};
|
use swf::{VideoCodec, VideoDeblocking};
|
||||||
|
|
||||||
|
@ -393,6 +394,13 @@ impl<'gc> NetStream<'gc> {
|
||||||
tracing::error!("FLV data parsing failed: {}", e)
|
tracing::error!("FLV data parsing failed: {}", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We cannot mutate stream state while also holding an active
|
||||||
|
// reader or any tags.
|
||||||
|
let (_, position) = reader.into_parts();
|
||||||
|
write.offset = position;
|
||||||
|
write.preload_offset = max(write.offset, write.preload_offset);
|
||||||
|
reader = FlvReader::from_parts(&write.buffer, position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue