summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBehnam Momeni2022-08-26 15:30:44 +0430
committerBehnam Momeni2022-08-26 15:30:44 +0430
commit69c737bd11ea47f2abfb737efa0ac913998f4fff (patch)
tree76ced713a6fd1d2563a88455b22d0ddd77737f4c
parent766dd4ba1715fc921fe26ce1bdcf22c30f4fc073 (diff)
downloadaur-69c737bd11ea47f2abfb737efa0ac913998f4fff.tar.gz
Fix compilation errors having ffmpeg 2:5.1
-rw-r--r--.SRCINFO6
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD9
-rw-r--r--fix_ffmpeg5.patch151
4 files changed, 162 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 59aaf6e52b97..2feca36de28e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Fri Feb 4 19:06:34 UTC 2022
+# Fri Aug 26 10:20:33 UTC 2022
pkgbase = bombono-dvd
pkgdesc = DVD authoring program with nice and clean GUI
pkgver = 1.2.4
- pkgrel = 6
+ pkgrel = 7
url = http://www.bombono.org
install = bombono-dvd.install
arch = i686
@@ -34,6 +34,7 @@ pkgbase = bombono-dvd
source = fix_throw_specifications.patch
source = fix_operator_ambiguity.patch
source = fix_ffmpeg30.patch
+ source = fix_ffmpeg5.patch
sha256sums = 4f8c882a0c359ca8c182a627885c64aa271820eead2f9a64b34f1625c3b0a9d7
sha256sums = 63e47ffb812acb33a4d1f5d7f421eb2ccdf3ee1ce1b7f75267c32079dbc9dea1
sha256sums = b0ff83b2fad27e39dfd77d12e00c25e554fe86ee1894c2f8fbe1915a2c46dd88
@@ -44,6 +45,7 @@ pkgbase = bombono-dvd
sha256sums = 72b3d6c76cbf98fb9287f7ee5b7a57b6febe2a635d50758c2451e376e3e6ca02
sha256sums = 9d56f7d16c55a506b092dbec00789e4767963d6202d3d92b79ad389393d43c69
sha256sums = f6fd3a309987ac08b6f70132686c5a06bc7496fb6e1097539d6348f558d09502
+ sha256sums = 45432a2c089f975f5ee04270c878ef61b98a6b114f2618cc47e61221b3a808ee
pkgname = bombono-dvd
diff --git a/.gitignore b/.gitignore
index b101a9aeac20..3b71fba5add5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
bombono-dvd-*.tar.bz2
+*.pkg.tar.zst
*.pkg.tar.xz
*.tar.gz
pkg/
diff --git a/PKGBUILD b/PKGBUILD
index ecfb65ec27ed..22d523b59026 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=bombono-dvd
pkgver=1.2.4
-pkgrel=6
+pkgrel=7
pkgdesc="DVD authoring program with nice and clean GUI"
arch=('i686' 'x86_64')
url="http://www.bombono.org"
@@ -22,7 +22,8 @@ source=("https://github.com/muravjov/${pkgname}/archive/${pkgver}.tar.gz"
"fix_deprecated_boost_api.patch"
"fix_throw_specifications.patch"
"fix_operator_ambiguity.patch"
- "fix_ffmpeg30.patch")
+ "fix_ffmpeg30.patch"
+ "fix_ffmpeg5.patch")
install=bombono-dvd.install
sha256sums=('4f8c882a0c359ca8c182a627885c64aa271820eead2f9a64b34f1625c3b0a9d7'
'63e47ffb812acb33a4d1f5d7f421eb2ccdf3ee1ce1b7f75267c32079dbc9dea1'
@@ -33,7 +34,8 @@ sha256sums=('4f8c882a0c359ca8c182a627885c64aa271820eead2f9a64b34f1625c3b0a9d7'
'a69f51f9d5bd6ebe26c13abeece9de012d110dcec944c76efbab59b6bc0ef915'
'72b3d6c76cbf98fb9287f7ee5b7a57b6febe2a635d50758c2451e376e3e6ca02'
'9d56f7d16c55a506b092dbec00789e4767963d6202d3d92b79ad389393d43c69'
- 'f6fd3a309987ac08b6f70132686c5a06bc7496fb6e1097539d6348f558d09502')
+ 'f6fd3a309987ac08b6f70132686c5a06bc7496fb6e1097539d6348f558d09502'
+ '45432a2c089f975f5ee04270c878ef61b98a6b114f2618cc47e61221b3a808ee')
prepare() {
cd "${pkgname}-${pkgver}"
@@ -46,6 +48,7 @@ prepare() {
patch -Np1 -i "${srcdir}/fix_throw_specifications.patch"
patch -Np1 -i "${srcdir}/fix_operator_ambiguity.patch"
patch -Np1 -i "${srcdir}/inc_boost_header.patch"
+ patch -Np1 -i "${srcdir}/fix_ffmpeg5.patch"
# python2 fix
for file in $(find . -name '*.py' -print); do
sed -i 's_#!.*/usr/bin/python_#!/usr/bin/python2_' $file
diff --git a/fix_ffmpeg5.patch b/fix_ffmpeg5.patch
new file mode 100644
index 000000000000..28cfa0aad61a
--- /dev/null
+++ b/fix_ffmpeg5.patch
@@ -0,0 +1,151 @@
+diff -ruN old/src/mgui/ffviewer.cpp new/src/mgui/ffviewer.cpp
+--- old/src/mgui/ffviewer.cpp 2022-08-26 11:00:17.936924594 +0430
++++ new/src/mgui/ffviewer.cpp 2022-08-26 14:41:31.887225381 +0430
+@@ -37,6 +37,7 @@
+ #endif
+
+ C_LINKAGE_BEGIN
++#include <libavcodec/avcodec.h>
+ #include <libavutil/imgutils.h>
+ C_LINKAGE_END
+
+@@ -111,7 +112,7 @@
+
+ AVCodecContext* GetVideoCtx(FFData& ffv)
+ {
+- return VideoStream(ffv)->codec;
++ return ffv.videoCtx;
+ }
+
+ static bool IsValidRational(const AVRational& r)
+@@ -294,6 +295,7 @@
+ #else
+ av_close_input_file(ffi.iCtx);
+ #endif
++ avcodec_free_context(&ffi.videoCtx);
+ ffi.iCtx = 0;
+ }
+ }
+@@ -437,8 +439,6 @@
+ {
+ std::string& err_str = diag.errStr;
+
+- av_register_all();
+-
+ ASSERT( !ffi.IsOpened() );
+ bool res = false;
+
+@@ -508,14 +508,14 @@
+ for( int i=0; i < (int)ic->nb_streams; i++ )
+ {
+ AVStream* strm = ic->streams[i];
+- AVCodecContext* avctx = strm->codec;
+- if( SetIndex(video_idx, i, avctx->codec_type == AVMEDIA_TYPE_VIDEO) )
++ AVCodecParameters* avcp = strm->codecpar;
++ if( SetIndex(video_idx, i, avcp->codec_type == AVMEDIA_TYPE_VIDEO) )
+ ;
+ else
+ // для демиксера имеет значение только NONE и ALL
+ strm->discard = AVDISCARD_ALL;
+
+- SetIndex(audio_idx, i, avctx->codec_type == AVMEDIA_TYPE_AUDIO);
++ SetIndex(audio_idx, i, avcp->codec_type == AVMEDIA_TYPE_AUDIO);
+ }
+
+ if( video_idx == -1 )
+@@ -562,23 +562,29 @@
+ }
+
+ // открытие кодека
+- AVCodecContext* dec = ic->streams[video_idx]->codec;
+- // для H.264 и плохих TS
+- dec->strict_std_compliance = FF_COMPLIANCE_STRICT;
++ AVCodecParameters* decp = ic->streams[video_idx]->codecpar;
+
+ // Chromium зачем-то выставляет явно, но такие значения уже по умолчанию
+ //dec->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
+ //dec->error_recognition = FF_ER_CAREFUL;
+
+- std::string tag_str = CodecID2Str(dec->codec_id);
++ std::string tag_str = CodecID2Str(decp->codec_id);
+ // AVCodec - это одиночка, а AVCodecContext - состояние для него
+ // в соответ. потоке контейнера
+- AVCodec* codec = avcodec_find_decoder(dec->codec_id);
++ const AVCodec* codec = avcodec_find_decoder(decp->codec_id);
+ if( !codec )
+ {
+ err_str = BF_("No decoder found for the stream: %1%") % tag_str % bf::stop;
+ return false;
+ }
++ AVCodecContext *dec;
++ ffi.videoCtx = dec = avcodec_alloc_context3(codec);
++ if( avcodec_parameters_to_context(dec, decp) < 0 )
++ {
++ err_str = _("Can't copy codec parameters");
++ return false;
++ }
++ dec->strict_std_compliance = FF_COMPLIANCE_STRICT;
+
+ // :TRICKY: вся полезна инфо о дорожке, включая размеры видео, реально парсится
+ // в av_find_stream_info(), а в avcodec_open() - кодек только привязывается к
+@@ -824,7 +830,15 @@
+ pkt->data = 0;
+ pkt->size = 0;
+ }
+- int av_res = avcodec_decode_video2(GetVideoCtx(ffv), &picture, &got_picture, pkt);
++ int av_res = avcodec_send_packet(GetVideoCtx(ffv), pkt);
++ if( av_res >= 0 )
++ {
++ av_res = avcodec_receive_frame(GetVideoCtx(ffv), &picture);
++ if( av_res >= 0 )
++ {
++ got_picture = 1;
++ }
++ }
+ #else
+ const uint8_t* buf = 0;
+ int buf_sz = 0;
+@@ -870,7 +884,8 @@
+ // в идеале длительность уже была рассчитана в предыдущем pkt->duration;
+ // пока же сделаем копипаст как в ffmpeg.c - см. особенности ffmpeg (compute_pkt_fields())
+ AVStream* st = VideoStream(ffv);
+- int ticks = st->parser ? st->parser->repeat_pict + 1 : dec->ticks_per_frame ;
++ AVCodecParserContext *pctx = av_stream_get_parser(st);
++ int ticks = pctx ? pctx->repeat_pict + 1 : dec->ticks_per_frame;
+ next_pts += VideoFrameLength(dec, ticks);
+ }
+
+@@ -1082,7 +1097,7 @@
+ // переход по позиции не работает для avi, mkv - см. особенности ffmpeg
+ // однако для без-заголовочных демиксеров (MPEG-PS, MPEG-TS) требуется
+
+- typedef std::map<std::string, AVInputFormat*> Map;
++ typedef std::map<std::string, const AVInputFormat*> Map;
+ static Map map;
+ if( map.empty() )
+ {
+diff -ruN old/src/mgui/ffviewer.h new/src/mgui/ffviewer.h
+--- old/src/mgui/ffviewer.h 2016-04-10 15:15:39.000000000 +0430
++++ new/src/mgui/ffviewer.h 2022-08-26 11:25:10.616129717 +0430
+@@ -70,6 +70,7 @@
+ struct FFData: public boost::noncopyable
+ {
+ AVFormatContext* iCtx;
++ AVCodecContext* videoCtx;
+ int videoIdx;
+ Point vidSz; // первоначальный размер
+
+diff -ruN old/src/mgui/project/media-browser.cpp new/src/mgui/project/media-browser.cpp
+--- old/src/mgui/project/media-browser.cpp 2016-04-10 15:15:39.000000000 +0430
++++ new/src/mgui/project/media-browser.cpp 2022-08-26 14:08:22.610955145 +0430
+@@ -240,8 +240,8 @@
+ a_cnt = 0;
+ for( int i=0; i < (int)ic->nb_streams; i++ )
+ {
+- AVCodecContext* avctx = ic->streams[i]->codec;
+- if( avctx->codec_type == AVMEDIA_TYPE_AUDIO )
++ AVCodecParameters* avp = ic->streams[i]->codecpar;
++ if( avp->codec_type == AVMEDIA_TYPE_AUDIO )
+ a_cnt++;
+ }
+