Skip to content

Commit

Permalink
feat(playback): report error with log
Browse files Browse the repository at this point in the history
  • Loading branch information
Yesterday17 committed Sep 3, 2023
1 parent e6307f5 commit 19a83e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions anni-playback/src/decoder/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ impl Decoder {
pub fn start(mut self) {
loop {
// Check if the preload thread is done.
if self.poll_preload_thread().is_err() {
// update_callback_stream(Callback::DecodeError);
if let Err(e) = self.poll_preload_thread() {
log::error!("Decode error on poll_preload_thread: {e}");
}

// Check for incoming `ThreadMessage`s.
Expand All @@ -115,8 +115,8 @@ impl Decoder {
break;
}
}
Err(_) => {
// update_callback_stream(Callback::DecodeError);
Err(e) => {
log::error!("Decode error on listen_for_message: {e}");
}
}

Expand All @@ -132,8 +132,8 @@ impl Decoder {
}
_ => (),
},
Err(_) => {
// update_callback_stream(Callback::DecodeError);
Err(e) => {
log::error!("Decode error on do_playback: {e}");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions anni-playback/src/sources/hls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ impl Read for HlsStream {
thread::spawn(move || {
let result = Self::read_chunk(tx, url, start, file_size);

if result.is_err() {
// update_callback_stream(Callback::NetworkStreamError)
if let Err(e) = result {
log::error!("Network stream error on hls::read_chunk : {e}");
}
});

Expand Down
4 changes: 2 additions & 2 deletions anni-playback/src/sources/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ impl Read for HttpStream {
thread::spawn(move || {
let result = Self::read_chunk(tx, url, chunk_write_pos, file_size);

if result.is_err() {
// update_callback_stream(Callback::NetworkStreamError)
if let Err(e) = result {
log::error!("Network stream error on http::read_chunk : {e}");
}
});
}
Expand Down

0 comments on commit 19a83e1

Please sign in to comment.