From a1311b887ba854bccacb913a745fa9f1ec82b11f Mon Sep 17 00:00:00 2001 From: gabrielalb Date: Wed, 15 Jan 2020 19:39:46 +0200 Subject: [PATCH 1/2] Fixed h264 codec finding in Debian9 (libavcodec < 58.10.100) --- gui/src/videodecoder.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/src/videodecoder.cpp b/gui/src/videodecoder.cpp index bd3f9653..5f19ee65 100644 --- a/gui/src/videodecoder.cpp +++ b/gui/src/videodecoder.cpp @@ -23,9 +23,13 @@ VideoDecoder::VideoDecoder(ChiakiLog *log) : log(log) { + #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100) + avcodec_register_all(); + #endif codec = avcodec_find_decoder(AV_CODEC_ID_H264); - if(!codec) + if(!codec) { throw VideoDecoderException("H264 Codec not available"); + } codec_context = avcodec_alloc_context3(codec); if(!codec_context) From 737f8a87fb2b4064c0397817e5c9a9522d347566 Mon Sep 17 00:00:00 2001 From: gabrielalb Date: Wed, 15 Jan 2020 19:45:58 +0200 Subject: [PATCH 2/2] Removed unnecessary parantheses --- gui/src/videodecoder.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gui/src/videodecoder.cpp b/gui/src/videodecoder.cpp index 5f19ee65..49371424 100644 --- a/gui/src/videodecoder.cpp +++ b/gui/src/videodecoder.cpp @@ -27,9 +27,8 @@ VideoDecoder::VideoDecoder(ChiakiLog *log) : log(log) avcodec_register_all(); #endif codec = avcodec_find_decoder(AV_CODEC_ID_H264); - if(!codec) { + if(!codec) throw VideoDecoderException("H264 Codec not available"); - } codec_context = avcodec_alloc_context3(codec); if(!codec_context)