Skip to content

Commit

Permalink
fix: avoid exception on malformed VLC log message
Browse files Browse the repository at this point in the history
  • Loading branch information
vzhd1701 committed Jun 25, 2022
1 parent fe3fb4c commit 5f0c23d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gridplayer/vlc_player/instance.py
Expand Up @@ -187,10 +187,10 @@ def _format_log_msg(self, args, ctx, fmt): # noqa: WPS210

# Format given fmt/args pair
str_len = vsnprintf(self._logger_buf, self._logger_buf_len, fmt, args)
log_txt = self._logger_buf.raw[:str_len].decode()
log_txt = self._logger_buf.raw[:str_len].decode(errors="ignore")

log_head = f"{m_file.decode()}:{m_line}"
log_msg = f"{m_name.decode()}: {log_txt}"
log_head = f"{m_file.decode(errors='ignore')}:{m_line}"
log_msg = f"{m_name.decode(errors='ignore')}: {log_txt}"

return log_head, log_msg

Expand Down

0 comments on commit 5f0c23d

Please sign in to comment.