core: Buffer overruns should not pause the stream unless we are actually at the end of the video.
This commit is contained in:
parent
14dec5dcce
commit
56c14be708
|
@ -1108,7 +1108,7 @@ impl<'gc> NetStream<'gc> {
|
||||||
let buffer = slice.data();
|
let buffer = slice.data();
|
||||||
|
|
||||||
let end_time = write.stream_time + dt;
|
let end_time = write.stream_time + dt;
|
||||||
let mut end_of_video = false;
|
let mut buffer_underrun = false;
|
||||||
let mut error = false;
|
let mut error = false;
|
||||||
let mut max_lookahead_audio_tags = 5;
|
let mut max_lookahead_audio_tags = 5;
|
||||||
let mut is_lookahead_tag = false;
|
let mut is_lookahead_tag = false;
|
||||||
|
@ -1126,7 +1126,7 @@ impl<'gc> NetStream<'gc> {
|
||||||
// those tags "for realsies"
|
// those tags "for realsies"
|
||||||
if !is_lookahead_tag && matches!(e, FlvError::EndOfData) {
|
if !is_lookahead_tag && matches!(e, FlvError::EndOfData) {
|
||||||
//TODO: Check expected total length for streaming / progressive download
|
//TODO: Check expected total length for streaming / progressive download
|
||||||
end_of_video = true;
|
buffer_underrun = true;
|
||||||
} else if !is_lookahead_tag {
|
} else if !is_lookahead_tag {
|
||||||
//Corrupt tag or out of data
|
//Corrupt tag or out of data
|
||||||
tracing::error!("FLV tag parsing failed: {}", e);
|
tracing::error!("FLV tag parsing failed: {}", e);
|
||||||
|
@ -1192,21 +1192,30 @@ impl<'gc> NetStream<'gc> {
|
||||||
}
|
}
|
||||||
drop(write);
|
drop(write);
|
||||||
|
|
||||||
if end_of_video {
|
if buffer_underrun {
|
||||||
|
let is_end_of_video = self.0.read().expected_length.is_none();
|
||||||
|
|
||||||
self.trigger_status_event(
|
self.trigger_status_event(
|
||||||
context,
|
context,
|
||||||
vec![("code", "NetStream.Buffer.Flush"), ("level", "status")],
|
vec![("code", "NetStream.Buffer.Flush"), ("level", "status")],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if is_end_of_video {
|
||||||
self.trigger_status_event(
|
self.trigger_status_event(
|
||||||
context,
|
context,
|
||||||
vec![("code", "NetStream.Play.Stop"), ("level", "status")],
|
vec![("code", "NetStream.Play.Stop"), ("level", "status")],
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
self.trigger_status_event(
|
self.trigger_status_event(
|
||||||
context,
|
context,
|
||||||
vec![("code", "NetStream.Buffer.Empty"), ("level", "status")],
|
vec![("code", "NetStream.Buffer.Empty"), ("level", "status")],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if is_end_of_video {
|
||||||
self.pause(context, false);
|
self.pause(context, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if error {
|
if error {
|
||||||
//TODO: Fire an error event at AS.
|
//TODO: Fire an error event at AS.
|
||||||
|
|
Loading…
Reference in New Issue