From 86e72f88c36b8e041d5f1f4a74444e02db400d95 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Tue, 2 Nov 2021 09:56:35 +0100 Subject: [PATCH] framereader.cc: better avformat_open_input error printing old-commit-hash: f8d050298ecf969e1890fe10120ee0a748ed7eba --- selfdrive/ui/replay/framereader.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/selfdrive/ui/replay/framereader.cc b/selfdrive/ui/replay/framereader.cc index 215414ec9c..f6e60b817b 100644 --- a/selfdrive/ui/replay/framereader.cc +++ b/selfdrive/ui/replay/framereader.cc @@ -75,8 +75,11 @@ bool FrameReader::load(const std::string &url, std::atomic *abort) { pFormatCtx_->pb = avio_ctx_; pFormatCtx_->probesize = 10 * 1024 * 1024; // 10MB - if (avformat_open_input(&pFormatCtx_, url.c_str(), NULL, NULL) != 0) { - printf("error loading %s\n", url.c_str()); + int err = avformat_open_input(&pFormatCtx_, url.c_str(), NULL, NULL); + if (err != 0) { + char err_str[1024] = {0}; + av_strerror(err, err_str, std::size(err_str)); + printf("Error loading video - %s - %s\n", err_str, url.c_str()); return false; } avformat_find_stream_info(pFormatCtx_, NULL);