[avidemux] Update to the 2.6.15 release, rfbz#4344
by Sérgio M. Basto
commit f26d4e98dc466e95e52ba6a1bc1c270b3dd7b576
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Tue Nov 22 03:28:43 2016 +0000
Update to the 2.6.15 release, rfbz#4344
.gitignore | 1 +
avidemux-2.6.10-bundled_libs.patch | 211 +++++++++++-----------
avidemux-2.6.10-qt5_lrelease.patch | 39 ----
avidemux-2.6.12-gcc6.patch | 218 -----------------------
avidemux-2.6.12-narrowing.patch | 23 ---
avidemux-2.6.12-qt.patch | 74 --------
avidemux-2.6.15-disable-vpx-decoder-plugin.patch | 7 +
avidemux-2.6.15-hwaccel.patch | 19 ++
avidemux-qt.desktop | 2 +-
avidemux.spec | 69 ++++---
sources | 2 +-
11 files changed, 167 insertions(+), 498 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e1804eb..8813633 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
avidemux_2.6.10.tar.gz
/avidemux_2.6.12.tar.gz
+/avidemux_2.6.15.tar.gz
diff --git a/avidemux-2.6.10-bundled_libs.patch b/avidemux-2.6.10-bundled_libs.patch
index 3223b2f..fda1d75 100644
--- a/avidemux-2.6.10-bundled_libs.patch
+++ b/avidemux-2.6.10-bundled_libs.patch
@@ -1,82 +1,20 @@
---- a/avidemux_plugins/CMakeLists.txt
-+++ b/avidemux_plugins/CMakeLists.txt
-@@ -37,6 +37,40 @@ include(admCoreIncludes)
- LINK_DIRECTORIES("${AVIDEMUX_SEARCH_LIB_DIR}")
- INCLUDE_DIRECTORIES("${AVIDEMUX_SEARCH_INCLUDE_DIR}/avidemux/2.6")
+diff --git a/avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/ADM_ad_a52.cpp b/avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/ADM_ad_a52.cpp
+index 6eddc3a..539405a 100644
+--- a/avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/ADM_ad_a52.cpp
++++ b/avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/ADM_ad_a52.cpp
+@@ -18,8 +18,8 @@
+ #include "ADM_ad_plugin.h"
-+#########################################
-+# Unbundle some libraries here
-+#########################################
-+OPTION(USE_EXTERNAL_LIBASS "Use system installed libass library." OFF)
-+OPTION(USE_EXTERNAL_LIBMAD "Use system installed libmad library." OFF)
-+OPTION(USE_EXTERNAL_LIBA52 "Use system installed liba52 library." OFF)
-+OPTION(USE_EXTERNAL_LIBTWOLAME "Use system installed libtwolame library." OFF)
-+
-+INCLUDE(FindPkgConfig)
-+
-+# libass
-+IF(USE_EXTERNAL_LIBASS)
-+ PKG_CHECK_MODULES(LIBASS REQUIRED libass)
-+ INCLUDE_DIRECTORIES(SYSTEM ${LIBASS_INCLUDE_DIRS})
-+ENDIF()
-+
-+# libmad
-+IF(USE_EXTERNAL_LIBMAD)
-+ PKG_CHECK_MODULES(LIBMAD REQUIRED mad)
-+ INCLUDE_DIRECTORIES(SYSTEM ${LIBMAD_INCLUDE_DIRS})
-+ENDIF()
-+
-+# liba52
-+IF(USE_EXTERNAL_LIBA52)
-+ FIND_PATH(LIBA52_INCLUDE_DIR a52dec/a52.h)
-+ FIND_LIBRARY(LIBA52_LIBRARIES a52)
-+ INCLUDE_DIRECTORIES(SYSTEM ${LIBA52_INCLUDE_DIR})
-+ENDIF()
-+
-+# twolame
-+IF(USE_EXTERNAL_TWOLAME)
-+ PKG_CHECK_MODULES(LIBTWOLAME REQUIRED twolame)
-+ INCLUDE_DIRECTORIES(SYSTEM ${LIBTWOLAME_INCLUDE_DIRS})
-+ENDIF()
+ extern "C" {
+-#include "ADM_liba52/a52.h"
+-#include "ADM_liba52/mm_accel.h"
++#include "a52dec/a52.h"
++#include "a52dec/mm_accel.h"
+ };
- IF (FRESH_BUILD)
- MESSAGE("")
---- a/avidemux_plugins/ADM_videoFilters6/ass/CMakeLists.txt
-+++ b/avidemux_plugins/ADM_videoFilters6/ass/CMakeLists.txt
-@@ -4,7 +4,6 @@ checkFreeType()
- checkFridibi("0.19")
-
- IF (USE_FREETYPE AND USE_FRIDIBI)
-- ADD_SUBDIRECTORY(ADM_libass)
-
- INCLUDE(vf_plugin)
- SET(ADM_vf_ssa_SRCS ADM_vidASS.cpp)
-@@ -12,7 +11,15 @@ IF (USE_FREETYPE AND USE_FRIDIBI)
- ADD_VIDEO_FILTER(ADM_vf_ssa ${ADM_vf_ssa_SRCS})
-
- IF(DO_COMMON)
-- TARGET_LINK_LIBRARIES(ADM_vf_ssa ADM_libass ${FREETYPE2_LDFLAGS} ${FRIDIBI_LDFLAGS} ADM_coreSubtitle)
-+# TARGET_LINK_LIBRARIES(ADM_vf_ssa ADM_libass ${FREETYPE2_LDFLAGS} ${FRIDIBI_LDFLAGS} ADM_coreSubtitle)
-+ IF(USE_EXTERNAL_LIBASS)
-+ TARGET_LINK_LIBRARIES(ADM_vf_ssa ${LIBASS_LIBRARIES}
-+ ${FREETYPE2_LDFLAGS} ADM_coreSubtitle)
-+ ELSE(USE_EXTERNAL_LIBASS)
-+ ADD_SUBDIRECTORY(ADM_libass)
-+ TARGET_LINK_LIBRARIES(ADM_vf_ssa ADM_libass
-+ ${FREETYPE2_LDFLAGS} ADM_coreSubtitle)
-+ ENDIF(USE_EXTERNAL_LIBASS)
- # We force the use of fontconfig
- ADD_DEFINITIONS("-DUSE_FONTCONFIG")
- TARGET_LINK_LIBRARIES(ADM_vf_ssa ${FONTCONFIG_LDFLAGS})
---- a/avidemux_plugins/ADM_videoFilters6/CMakeLists.txt
-+++ b/avidemux_plugins/ADM_videoFilters6/CMakeLists.txt
-@@ -1,6 +1,5 @@
- ADD_SUBDIRECTORY(addBorder)
- ADD_SUBDIRECTORY(asharp)
--ADD_SUBDIRECTORY(ass)
- ADD_SUBDIRECTORY(avsfilter)
- ADD_SUBDIRECTORY(black)
- ADD_SUBDIRECTORY(blackenBorder)
+ #define AC3_HANDLE ((a52_state_t *)ac3_handle)
+diff --git a/avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/CMakeLists.txt b/avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/CMakeLists.txt
+index 04fbdc6..f769ded 100644
--- a/avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/CMakeLists.txt
+++ b/avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/CMakeLists.txt
@@ -1,11 +1,18 @@
@@ -100,10 +38,25 @@
INIT_AUDIO_PLUGIN(ADM_ad_a52)
INSTALL_AUDIODECODER(ADM_ad_a52)
+diff --git a/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/ADM_ad_mad.cpp b/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/ADM_ad_mad.cpp
+index 171b413..5bddd56 100644
+--- a/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/ADM_ad_mad.cpp
++++ b/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/ADM_ad_mad.cpp
+@@ -16,7 +16,7 @@
+ ***************************************************************************/
+ #include "ADM_default.h"
+ #include "ADM_ad_plugin.h"
+-#include "ADM_libMad/mad.h"
++#include "mad.h"
+
+ #define Stream ((mad_stream *)_stream)
+ #define Frame ((mad_frame *)_frame)
+diff --git a/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/CMakeLists.txt b/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/CMakeLists.txt
+index e7e91e8..fa9ec90 100644
--- a/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/CMakeLists.txt
+++ b/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/CMakeLists.txt
-@@ -8,13 +8,20 @@ ELSEIF (ADM_CPU_PPC)
- ADD_DEFINITIONS("-DFPM_PPC")
+@@ -10,13 +10,20 @@ ELSEIF (ADM_CPU_ARMEL)
+ ADD_DEFINITIONS("-DFPM_ARM")
ENDIF (ADM_CPU_X86_32)
-ADD_SUBDIRECTORY(ADM_libMad)
@@ -125,30 +78,8 @@
INIT_AUDIO_PLUGIN(ADM_ad_Mad)
INSTALL_AUDIODECODER(ADM_ad_Mad)
---- a/avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/ADM_ad_a52.cpp
-+++ b/avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/ADM_ad_a52.cpp
-@@ -18,8 +18,8 @@
- #include "ADM_ad_plugin.h"
-
- extern "C" {
--#include "ADM_liba52/a52.h"
--#include "ADM_liba52/mm_accel.h"
-+#include "a52dec/a52.h"
-+#include "a52dec/mm_accel.h"
- };
-
- #define AC3_HANDLE ((a52_state_t *)ac3_handle)
---- a/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/ADM_ad_mad.cpp
-+++ b/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/ADM_ad_mad.cpp
-@@ -16,7 +16,7 @@
- ***************************************************************************/
- #include "ADM_default.h"
- #include "ADM_ad_plugin.h"
--#include "ADM_libMad/mad.h"
-+#include "mad.h"
-
- #define Stream ((mad_stream *)_stream)
- #define Frame ((mad_frame *)_frame)
+diff --git a/avidemux_plugins/ADM_videoFilters6/ass/ADM_vidASS.cpp b/avidemux_plugins/ADM_videoFilters6/ass/ADM_vidASS.cpp
+index baadf0c..9ad93cd 100644
--- a/avidemux_plugins/ADM_videoFilters6/ass/ADM_vidASS.cpp
+++ b/avidemux_plugins/ADM_videoFilters6/ass/ADM_vidASS.cpp
@@ -24,7 +24,7 @@
@@ -160,3 +91,77 @@
}
/**
+diff --git a/avidemux_plugins/ADM_videoFilters6/ass/CMakeLists.txt b/avidemux_plugins/ADM_videoFilters6/ass/CMakeLists.txt
+index f793fe0..d49efc4 100644
+--- a/avidemux_plugins/ADM_videoFilters6/ass/CMakeLists.txt
++++ b/avidemux_plugins/ADM_videoFilters6/ass/CMakeLists.txt
+@@ -5,7 +5,6 @@ checkFreeType()
+ checkFridibi("0.19")
+
+ IF (USE_FREETYPE AND USE_FRIDIBI)
+- ADD_SUBDIRECTORY(ADM_libass)
+
+ INCLUDE(vf_plugin)
+ SET(ADM_vf_ssa_SRCS ADM_vidASS.cpp)
+@@ -13,7 +12,15 @@ IF (USE_FREETYPE AND USE_FRIDIBI)
+ ADD_VIDEO_FILTER(ADM_vf_ssa ${ADM_vf_ssa_SRCS})
+
+ IF(DO_COMMON)
+- TARGET_LINK_LIBRARIES(ADM_vf_ssa ADM_libass ${FREETYPE2_LDFLAGS} ${FRIDIBI_LDFLAGS} ADM_coreSubtitle)
++# TARGET_LINK_LIBRARIES(ADM_vf_ssa ADM_libass ${FREETYPE2_LDFLAGS} ${FRIDIBI_LDFLAGS} ADM_coreSubtitle)
++ IF(USE_EXTERNAL_LIBASS)
++ TARGET_LINK_LIBRARIES(ADM_vf_ssa ${LIBASS_LIBRARIES}
++ ${FREETYPE2_LDFLAGS} ADM_coreSubtitle)
++ ELSE(USE_EXTERNAL_LIBASS)
++ ADD_SUBDIRECTORY(ADM_libass)
++ TARGET_LINK_LIBRARIES(ADM_vf_ssa ADM_libass
++ ${FREETYPE2_LDFLAGS} ADM_coreSubtitle)
++ ENDIF(USE_EXTERNAL_LIBASS)
+ # We force the use of fontconfig
+ ADD_DEFINITIONS("-DUSE_FONTCONFIG")
+ TARGET_LINK_LIBRARIES(ADM_vf_ssa ${FONTCONFIG_LDFLAGS})
+diff --git a/avidemux_plugins/CMakeLists.txt b/avidemux_plugins/CMakeLists.txt
+index 0333abd..0a57523 100644
+--- a/avidemux_plugins/CMakeLists.txt
++++ b/avidemux_plugins/CMakeLists.txt
+@@ -64,6 +64,40 @@ include(admCoreIncludes)
+ LINK_DIRECTORIES("${AVIDEMUX_SEARCH_LIB_DIR}")
+ INCLUDE_DIRECTORIES("${AVIDEMUX_SEARCH_INCLUDE_DIR}/avidemux/2.6")
+
++#########################################
++# Unbundle some libraries here
++#########################################
++OPTION(USE_EXTERNAL_LIBASS "Use system installed libass library." OFF)
++OPTION(USE_EXTERNAL_LIBMAD "Use system installed libmad library." OFF)
++OPTION(USE_EXTERNAL_LIBA52 "Use system installed liba52 library." OFF)
++OPTION(USE_EXTERNAL_LIBTWOLAME "Use system installed libtwolame library." OFF)
++
++INCLUDE(FindPkgConfig)
++
++# libass
++IF(USE_EXTERNAL_LIBASS)
++ PKG_CHECK_MODULES(LIBASS REQUIRED libass)
++ INCLUDE_DIRECTORIES(SYSTEM ${LIBASS_INCLUDE_DIRS})
++ENDIF()
++
++# libmad
++IF(USE_EXTERNAL_LIBMAD)
++ PKG_CHECK_MODULES(LIBMAD REQUIRED mad)
++ INCLUDE_DIRECTORIES(SYSTEM ${LIBMAD_INCLUDE_DIRS})
++ENDIF()
++
++# liba52
++IF(USE_EXTERNAL_LIBA52)
++ FIND_PATH(LIBA52_INCLUDE_DIR a52dec/a52.h)
++ FIND_LIBRARY(LIBA52_LIBRARIES a52)
++ INCLUDE_DIRECTORIES(SYSTEM ${LIBA52_INCLUDE_DIR})
++ENDIF()
++
++# twolame
++IF(USE_EXTERNAL_TWOLAME)
++ PKG_CHECK_MODULES(LIBTWOLAME REQUIRED twolame)
++ INCLUDE_DIRECTORIES(SYSTEM ${LIBTWOLAME_INCLUDE_DIRS})
++ENDIF()
+
+ IF (FRESH_BUILD)
+ MESSAGE("")
diff --git a/avidemux-2.6.15-disable-vpx-decoder-plugin.patch b/avidemux-2.6.15-disable-vpx-decoder-plugin.patch
new file mode 100644
index 0000000..4db936d
--- /dev/null
+++ b/avidemux-2.6.15-disable-vpx-decoder-plugin.patch
@@ -0,0 +1,7 @@
+diff --git a/avidemux_plugins/ADM_videoDecoder/CMakeLists.txt b/avidemux_plugins/ADM_videoDecoder/CMakeLists.txt
+index 9586aff..e953354 100644
+--- a/avidemux_plugins/ADM_videoDecoder/CMakeLists.txt
++++ b/avidemux_plugins/ADM_videoDecoder/CMakeLists.txt
+@@ -1 +1 @@
+-ADD_SUBDIRECTORY(vpx)
++#ADD_SUBDIRECTORY(vpx)
diff --git a/avidemux-2.6.15-hwaccel.patch b/avidemux-2.6.15-hwaccel.patch
new file mode 100644
index 0000000..00ff7d5
--- /dev/null
+++ b/avidemux-2.6.15-hwaccel.patch
@@ -0,0 +1,19 @@
+diff --git a/avidemux/common/gui_main.cpp b/avidemux/common/gui_main.cpp
+index c27f279..536178b 100644
+--- a/avidemux/common/gui_main.cpp
++++ b/avidemux/common/gui_main.cpp
+@@ -1578,12 +1578,14 @@ ADM_RENDER_TYPE UI_getPreferredRender(void)
+ {
+ return RENDER_GTK;
+ }
++#if 0
+ if(strcmp(displ,":0") && strcmp(displ,":0.0"))
+ {
+ printf("Looks like remote display, no Xv :%s\n",displ);
+ return RENDER_GTK;
+ }
+ #endif
++#endif
+
+ if(prefs->get(VIDEODEVICE,&renderI)!=RC_OK)
+ {
diff --git a/avidemux-qt.desktop b/avidemux-qt.desktop
index 5aee1ed..24bd18c 100644
--- a/avidemux-qt.desktop
+++ b/avidemux-qt.desktop
@@ -2,7 +2,7 @@
Name=Avidemux Video Editor (Qt)
Comment=Graphical video editing tool - Qt interface
Icon=avidemux
-Exec=avidemux3_qt4
+Exec=avidemux3_qt5
MimeType=video/mpeg;video/quicktime;video/x-msvideo;video/x-anim;audio/x-mp3;audio/x-mp2;
Terminal=false
Type=Application
diff --git a/avidemux.spec b/avidemux.spec
index d27c602..8c97c8f 100644
--- a/avidemux.spec
+++ b/avidemux.spec
@@ -1,8 +1,8 @@
%global _pkgbuilddir %{_builddir}/%{name}_%{version}
Name: avidemux
-Version: 2.6.12
-Release: 7%{?dist}
+Version: 2.6.15
+Release: 1%{?dist}
Summary: Graphical video editing and transcoding tool
License: GPLv2+
@@ -11,10 +11,8 @@ Source0: http://downloads.sourceforge.net/%{name}/%{name}_%{version}.tar.
Source1: avidemux-qt.desktop
Patch0: avidemux-2.6.10-bundled_libs.patch
-Patch1: avidemux-2.6.10-qt5_lrelease.patch
-Patch2: avidemux-2.6.12-narrowing.patch
-Patch3: avidemux-2.6.12-gcc6.patch
-Patch4: avidemux-2.6.12-qt.patch
+Patch1: avidemux-2.6.15-hwaccel.patch
+Patch2: avidemux-2.6.15-disable-vpx-decoder-plugin.patch
# Don't try to build on arm
ExcludeArch: %{arm}
@@ -26,6 +24,7 @@ BuildRequires: libxslt
BuildRequires: desktop-file-utils
BuildRequires: pkgconfig
BuildRequires: sqlite-devel
+BuildRequires: bzip2
# Libraries
BuildRequires: yasm-devel
@@ -44,9 +43,9 @@ BuildRequires: alsa-lib-devel >= 1.0.3
BuildRequires: pulseaudio-libs-devel
# Video out
-BuildRequires: SDL-devel >= 1.2.7
BuildRequires: mesa-libGL-devel mesa-libGLU-devel
BuildRequires: libvdpau-devel
+BuildRequires: libva-devel
# Audio Codecs
BuildRequires: a52dec-devel >= 0.7.4
@@ -69,7 +68,6 @@ BuildRequires: ffmpeg-devel
# Main package is a metapackage, bring in something useful.
Requires: %{name}-gui = %{version}-%{release}
-Requires: %{name}-help = %{version}-%{release}
%description
@@ -96,25 +94,17 @@ This package contains the runtime libraries for %{name}.
%package qt
Summary: Qt interface for %{name}
-BuildRequires: qt4-devel >= 4.5.0-9
+BuildRequires: qt5-qtbase-devel
+BuildRequires: qt5-linguist
BuildRequires: libxslt
Provides: %{name}-gui = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-gtk < 2.6.10
+Obsoletes: %{name}-help
%description qt
This package contains the Qt graphical interface for %{name}.
-%package help
-Summary: Help files for %{name}
-Requires: %{name} = %{version}-%{release}
-Requires: %{name}-gui = %{version}-%{release}
-BuildArch: noarch
-
-%description help
-This package contains the help files for %{name}.
-
-
%package i18n
Summary: Translations for %{name}
Requires: %{name} = %{version}-%{release}
@@ -128,10 +118,8 @@ This package contains translation files for %{name}.
%prep
%setup -q -n %{name}_%{version}
%patch0 -p1
-%patch1 -p1 -b .bund_libs
+%patch1 -p1
%patch2 -p1
-%patch3 -p1
-%patch4 -p1
# Remove sources of bundled libraries.
rm -rf avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/ADM_liba52 \
@@ -139,7 +127,6 @@ rm -rf avidemux_plugins/ADM_audioDecoders/ADM_ad_ac3/ADM_liba52 \
avidemux_plugins/ADM_audioEncoders/twolame/ADM_libtwolame \
avidemux_plugins/ADM_videoFilters6/ass/ADM_libass
-
%build
# Build avidemux_core
export LDFLAGS="-lc -Wl,--as-needed"
@@ -162,10 +149,11 @@ make %{?_smp_mflags}
make install DESTDIR=%{_pkgbuilddir}/fakeRoot
popd
-# Build QT4 gui
-rm -rf build_qt4 && mkdir build_qt4 && pushd build_qt4
+# Build QT5 gui
+rm -rf build_qt5 && mkdir build_qt5 && pushd build_qt5
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DFAKEROOT=%{_pkgbuilddir}/fakeRoot \
+ -DENABLE_QT5=TRUE \
../avidemux/qt4
make %{?_smp_mflags}
make install DESTDIR=%{_pkgbuilddir}/fakeRoot
@@ -192,6 +180,7 @@ rm -rf build_plugins_cli && mkdir build_plugins_cli && pushd build_plugins_cli
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DFAKEROOT=%{_pkgbuilddir}/fakeRoot \
-DAVIDEMUX_SOURCE_DIR=%{_builddir}/%{name}_%{version} \
+ -DENABLE_QT5=TRUE \
-DPLUGIN_UI=CLI \
-DUSE_EXTERNAL_LIBASS=TRUE \
-DUSE_EXTERNAL_LIBMAD=TRUE \
@@ -202,11 +191,12 @@ make %{?_smp_mflags}
make install DESTDIR=%{_pkgbuilddir}/fakeRoot
popd
-# Build avidemux_plugins_qt4
-rm -rf build_plugins_qt4 && mkdir build_plugins_qt4 && pushd build_plugins_qt4
+# Build avidemux_plugins_qt5
+rm -rf build_plugins_qt5 && mkdir build_plugins_qt5 && pushd build_plugins_qt5
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DFAKEROOT=%{_pkgbuilddir}/fakeRoot \
-DAVIDEMUX_SOURCE_DIR=%{_builddir}/%{name}_%{version} \
+ -DENABLE_QT5=TRUE \
-DPLUGIN_UI=QT4 \
-DUSE_EXTERNAL_LIBASS=TRUE \
-DUSE_EXTERNAL_LIBMAD=TRUE \
@@ -221,10 +211,10 @@ popd
%install
make -C build_core install DESTDIR=%{buildroot}
make -C build_cli install DESTDIR=%{buildroot}
-make -C build_qt4 install DESTDIR=%{buildroot}
+make -C build_qt5 install DESTDIR=%{buildroot}
make -C build_plugins_common install DESTDIR=%{buildroot}
make -C build_plugins_cli install DESTDIR=%{buildroot}
-make -C build_plugins_qt4 install DESTDIR=%{buildroot}
+make -C build_plugins_qt5 install DESTDIR=%{buildroot}
# Remove useless devel files
rm -rf %{buildroot}%{_includedir}/%{name}
@@ -298,24 +288,25 @@ fi
#%{_datadir}/applications/rpmfusion-avidemux-gtk.desktop
%files qt
-%{_bindir}/avidemux3_qt4
-%{_bindir}/avidemux3_jobs_qt4
+%{_bindir}/avidemux3_qt5
+%{_bindir}/avidemux3_jobs_qt5
+%{_libdir}/libADM_openGLQT*.so
%{_libdir}/libADM_UIQT*.so
-%{_libdir}/libADM_render6_QT4.so
+%{_libdir}/libADM_render6_QT5.so
%{_datadir}/applications/rpmfusion-avidemux-qt.desktop
# QT plugins
-%{_libdir}/ADM_plugins6/videoEncoders/qt4/
-%{_libdir}/ADM_plugins6/videoFilters/qt4/
-%{_libdir}/ADM_plugins6/scriptEngines/qt4/
-
-%files help
-%{_datadir}/avidemux6/help/
+%{_libdir}/ADM_plugins6/videoEncoders/qt5/
+%{_libdir}/ADM_plugins6/videoFilters/qt5/
+%{_libdir}/ADM_plugins6/shaderDemo/
%files i18n
-%{_datadir}/avidemux6/qt4/i18n/
+%{_datadir}/avidemux6/qt5/i18n/
%changelog
+* Tue Nov 22 2016 Sérgio Basto <sergio(a)serjux.com> - 2.6.15-1
+- Update to the 2.6.15 release, rfbz#4344
+
* Tue Nov 08 2016 Sérgio Basto <sergio(a)serjux.com> - 2.6.12-7
- Rebuild for x265-2.1
diff --git a/sources b/sources
index 1ff27ba..c2fdee0 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-354d8ddf75d48d1f698786e8243ecc54 avidemux_2.6.12.tar.gz
+2a822d96548d9dca19c805d46be424fc avidemux_2.6.15.tar.gz
8 years
[VirtualBox] New upstream release, 5.1.10
by Sérgio M. Basto
commit 7ea7191472c27d5e27cb0ca491b268787a814960
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Tue Nov 22 03:23:24 2016 +0000
New upstream release, 5.1.10
.gitignore | 1 +
VirtualBox-5.1.0-add-Mageia-support.patch | 2 +-
VirtualBox.spec | 7 +++++--
sources | 2 +-
4 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 4eef0af..525b6e5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,4 @@ VirtualBox-5.0.16.tar.bz2
/VirtualBox-5.1.4.tar.bz2
/VirtualBox-5.1.6.tar.bz2
/VirtualBox-5.1.8.tar.bz2
+/VirtualBox-5.1.10.tar.bz2
diff --git a/VirtualBox-5.1.0-add-Mageia-support.patch b/VirtualBox-5.1.0-add-Mageia-support.patch
index 258f651..d18f312 100644
--- a/VirtualBox-5.1.0-add-Mageia-support.patch
+++ b/VirtualBox-5.1.0-add-Mageia-support.patch
@@ -86,8 +86,8 @@ diff -Nurp VirtualBox-5.1.0.p9/src/VBox/Installer/linux/distributions_rpm Virtua
+mga2 = MAGEIA_2
+mga1 = MAGEIA_1
mdv2011.0 = MANDRIVA_2011_0
+ fedora25 = FEDORA_25
fedora24 = FEDORA_24
- fedora22 = FEDORA_22
diff -Nurp VirtualBox-5.1.0.p9/src/VBox/Installer/linux/VBoxSysInfo.sh VirtualBox-5.1.0.p13/src/VBox/Installer/linux/VBoxSysInfo.sh
--- VirtualBox-5.1.0.p9/src/VBox/Installer/linux/VBoxSysInfo.sh 2016-07-12 17:54:27.000000000 +0300
+++ VirtualBox-5.1.0.p13/src/VBox/Installer/linux/VBoxSysInfo.sh 2016-07-13 01:03:14.387225695 +0300
diff --git a/VirtualBox.spec b/VirtualBox.spec
index 1bc6085..ac99fa9 100644
--- a/VirtualBox.spec
+++ b/VirtualBox.spec
@@ -23,9 +23,9 @@
%bcond_with vnc
Name: VirtualBox
-Version: 5.1.8
+Version: 5.1.10
#Release: 1%%{?prerel:.%%{prerel}}%%{?dist}
-Release: 2%{?dist}
+Release: 1%{?dist}
Summary: A general-purpose full virtualizer for PC hardware
License: GPLv2 or (GPLv2 and CDDL)
@@ -760,6 +760,9 @@ getent group vboxsf >/dev/null || groupadd -r vboxsf 2>&1
%{_datadir}/%{name}-kmod-%{version}
%changelog
+* Tue Nov 22 2016 Sérgio Basto <sergio(a)serjux.com> - 5.1.10-1
+- New upstream release, 5.1.10
+
* Wed Oct 19 2016 Sérgio Basto <sergio(a)serjux.com> - 5.1.8-2
- Fixes for EL7 and X.org-1.19
diff --git a/sources b/sources
index 103dd2b..e062c49 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-6a294ccb318cd605ca99df5dc2c20477 VirtualBox-5.1.8.tar.bz2
+889d90a7d8119a6bcc699be258ca4a96 VirtualBox-5.1.10.tar.bz2
8 years
[audacity-freeworld] Use bcond_without correctly, fix wx-config-3.0-gtk2 detection, also simplify
by Sérgio M. Basto
commit 77eb5e25552ea46e3710cde70ead41e10a078fc7
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Tue Nov 22 01:51:01 2016 +0000
Use bcond_without correctly, fix wx-config-3.0-gtk2 detection, also simplify
some comments
audacity-freeworld.spec | 33 +++++++++++++++------------------
1 file changed, 15 insertions(+), 18 deletions(-)
---
diff --git a/audacity-freeworld.spec b/audacity-freeworld.spec
index 63457b3..c646478 100644
--- a/audacity-freeworld.spec
+++ b/audacity-freeworld.spec
@@ -1,11 +1,5 @@
# invoke with: rpmbuild --without mp3 audacity-freeworld.spec to undefine mp3.
%bcond_without mp3
-%if %{without mp3}
-# user passed [--without mp3]. Yes, rpm logic seems wrong!
-%define mp3importexport 0
-%else
-%define mp3importexport 1
-%endif
%global commit0 53a5c930a4b5b053ab06a8b975458fc51cf41f6c
%global shortcommit0 %(c=%#{commit0}; echo ${c:0:7})
@@ -13,7 +7,7 @@
Name: audacity-freeworld
Version: 2.1.3
-Release: 0.8.20161109git53a5c93%{?dist}
+Release: 0.9.20161109git53a5c93%{?dist}
Summary: Multitrack audio editor
Group: Applications/Multimedia
License: GPLv2
@@ -65,14 +59,13 @@ BuildRequires: soxr-devel
BuildRequires: vamp-plugin-sdk-devel >= 2.0
BuildRequires: zip
BuildRequires: zlib-devel
-# We need /usr/bin/wx-config so that configure can detect the wx-config version:
-BuildRequires: wxGTK3-devel
+#BuildRequires: wxGTK3-devel
# But we will actually use the --toolkit=gtk2 version using --with-wx-version
BuildRequires: compat-wxGTK3-gtk2-devel
-%if 0%{?rhel} >= 8 || 0%{?fedora}
+%if 0%{?rhel} >= 8 || 0%{?fedora}
BuildRequires: libappstream-glib
%endif
-%if 0%{mp3importexport}
+%if %{with mp3}
BuildRequires: libmad-devel
BuildRequires: twolame-devel
%endif
@@ -96,8 +89,8 @@ This build has support for mp3 and ffmpeg import/export.
%setup -q -n %{tartopdir}
# Substitute hardcoded library paths.
-# %#patch1 -b .libmp3lame-default
-# %#patch2 -p1 -b .libdir
+#patch1 -b .libmp3lame-default
+#patch2 -p1 -b .libdir
for i in src/AudacityApp.cpp src/export/ExportMP3.cpp
do
sed -i -e 's!__RPM_LIBDIR__!%{_libdir}!g' $i
@@ -111,12 +104,14 @@ do
sed -i -e 's!libmp3lame.so\([^.]\)!libmp3lame.so.0\1!g' $i
done
-# %#patch3 -b .desktop.old
+#patch3 -b .desktop.old
%patch4 -p1 -b .2.0.6-non-dl-ffmpeg
%build
-export PKG_CONFIG_PATH=%{_libdir}/ffmpeg-compat/pkgconfig/
+#export PKG_CONFIG_PATH=%{_libdir}/ffmpeg-compat/pkgconfig/
+export WX_CONFIG=wx-config-3.0-gtk2
+
%configure \
--disable-dynamic-loading \
--with-help \
@@ -134,9 +129,7 @@ export PKG_CONFIG_PATH=%{_libdir}/ffmpeg-compat/pkgconfig/
--with-libvamp=system \
--with-portaudio=system \
--with-ffmpeg=system \
- --with-libmad=system \
- --with-libtwolame=system \
-%if 0%{mp3importexport}
+%if %{with mp3}
--with-libmad=system \
--with-libtwolame=system \
%else
@@ -226,6 +219,10 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
%changelog
+* Tue Nov 22 2016 Sérgio Basto <sergio(a)serjux.com> - 2.1.3-0.9.20161109git53a5c93
+- Use bcond_without correctly, fix wx-config-3.0-gtk2 detection, also simplify
+ some comments
+
* Thu Nov 17 2016 David Timms <iinet.net.au@dtimms> - 2.1.3-0.8.20161109git53a5c93
- fix mp3 build parameter by defining mp3importexport conditional.
8 years
[dvbcut/f24] rebuild for ffmpeg-3.0.3
by David Timms
Summary of changes:
9064cb5... rebuild for ffmpeg-3.0.3 (*)
(*) This commit already existed in another branch; no separate mail sent
8 years
[dvbcut] rebuild for ffmpeg-3.0.3
by Nicolas Chauvet
commit 16855b45c9759174b1881a8d2f06d8f582f3e994
Author: David Timms <dtimms(a)iinet.net.au>
Date: Mon Nov 7 23:00:42 2016 +1100
rebuild for ffmpeg-3.0.3
- add combined patch covering:
- ffmpeg-3.0.3 for removed deprecated definitions and functions.
- signed-unsigned comparison warnings.
- whitespace alignment warnings.
- replace tabs with spaces to match existing source files.
- c++ compiler c11 fixes (not compatble with <=F23).
- unused variables.
dvbcut-svn179-ffmpeg-3.0.3-compatibility.patch | 1100 ++++++++++++++++++++++++
dvbcut.spec | 14 +-
2 files changed, 1113 insertions(+), 1 deletion(-)
---
diff --git a/dvbcut-svn179-ffmpeg-3.0.3-compatibility.patch b/dvbcut-svn179-ffmpeg-3.0.3-compatibility.patch
new file mode 100644
index 0000000..2f1e756
--- /dev/null
+++ b/dvbcut-svn179-ffmpeg-3.0.3-compatibility.patch
@@ -0,0 +1,1100 @@
+diff -ur dvbcut-svn179.orig/src/avframe.cpp dvbcut-svn179/src/avframe.cpp
+--- dvbcut-svn179.orig/src/avframe.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/avframe.cpp 2016-11-05 18:14:00.482888961 +1100
+@@ -23,26 +23,52 @@
+ #include <cstdio>
+ #include "avframe.h"
+
++#define IMAGE_ALIGN_VALUE 1 // no idea what an ideal value is.
++
+ #ifdef HAVE_LIB_SWSCALE
+ avframe::avframe() : tobefreed(0),w(0),h(0),dw(0),pix_fmt(),img_convert_ctx(0)
+ #else
+ avframe::avframe() : tobefreed(0),w(0),h(0),dw(0),pix_fmt()
+ #endif
+ {
+- f=avcodec_alloc_frame();
++ f=av_frame_alloc();
+ }
+
+ avframe::avframe(AVFrame *src, AVCodecContext *ctx) : f(0),tobefreed(0)
+ {
+- f=avcodec_alloc_frame();
+- tobefreed=malloc(avpicture_get_size(ctx->pix_fmt, ctx->width, ctx->height));
+-
+- avpicture_fill((AVPicture *)f,
++ f=av_frame_alloc();
++/*
++int avpicture_get_size (enum AVPixelFormat pix_fmt, int width, int height)
++Deprecated:
++ use av_image_get_buffer_size() instead:
++int av_image_get_buffer_size (enum AVPixelFormat pix_fmt, int width, int height, int align)
++https://www.ffmpeg.org/doxygen/3.0/group__lavu__picture.html#ga24a67963c3ae0054a2a4bab35930e694
++
++*/
++ tobefreed=malloc(av_image_get_buffer_size(ctx->pix_fmt, ctx->width, ctx->height, IMAGE_ALIGN_VALUE));
++
++/*
++int avpicture_fill (AVPicture * picture, const uint8_t * ptr
++ , enum AVPixelFormat pix_fmt, int width, int height)
++Deprecated:
++ use av_image_fill_arrays() instead:
++int av_image_fill_arrays(uint8_t * dst_data[4], int dst_linesize[4], const uint8_t * src
++ , enum AVPixelFormat pix_fmt, int width, int height, int align)
++*/
++ av_image_fill_arrays(f->data, f->linesize,
+ (u_int8_t*)tobefreed,
+- ctx->pix_fmt,ctx->width,ctx->height);
++ ctx->pix_fmt, ctx->width, ctx->height, IMAGE_ALIGN_VALUE);
+
+-#if LIBAVCODEC_VERSION_INT >= (51 << 16)
+- av_picture_copy((AVPicture *)f, (const AVPicture *) src,
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(51, 0, 0)
++/*
++void av_picture_copy(AVPicture * dst, const AVPicture * src
++ , enum AVPixelFormat pix_fmt, int width, int height)
++Deprecated: av_image_copy() instead:
++void av_image_copy (uint8_t * dst_data[4], int dst_linesizes[4]
++ , const uint8_t * src_data[4], const int src_linesizes[4]
++ , enum AVPixelFormat pix_fmt, int width, int height)
++*/
++ av_image_copy(f->data, f->linesize, (const uint8_t **)src->data, src->linesize,
+ ctx->pix_fmt, ctx->width, ctx->height);
+ #else
+ img_copy((AVPicture *)f, (const AVPicture *) src,
+@@ -65,7 +91,7 @@
+ dw=w*ctx->sample_aspect_ratio.num/ctx->sample_aspect_ratio.den;
+ #ifdef HAVE_LIB_SWSCALE
+ img_convert_ctx=sws_getContext(w, h, pix_fmt,
+- w, h, PIX_FMT_BGR24, SWS_BICUBIC,
++ w, h, AV_PIX_FMT_BGR24, SWS_BICUBIC,
+ NULL, NULL, NULL);
+ #endif
+ }
+@@ -91,20 +117,20 @@
+ #endif
+ return QImage();
+
+- uint8_t *rgbbuffer=(uint8_t*)malloc(avpicture_get_size(PIX_FMT_RGB24, w, h)+64);
++ uint8_t *rgbbuffer=(uint8_t*)malloc(av_image_get_buffer_size(AV_PIX_FMT_RGB24, w, h, IMAGE_ALIGN_VALUE)+64);
+ int headerlen=sprintf((char *) rgbbuffer, "P6\n%d %d\n255\n", w, h);
+
+- AVFrame *avframergb=avcodec_alloc_frame();
++ AVFrame *avframergb=av_frame_alloc();
+
+- avpicture_fill((AVPicture*)avframergb,
++ av_image_fill_arrays(avframergb->data, avframergb->linesize,
+ rgbbuffer+headerlen,
+- PIX_FMT_RGB24,w,h);
++ AV_PIX_FMT_RGB24, w, h, IMAGE_ALIGN_VALUE);
+
+ #ifdef HAVE_LIB_SWSCALE
+ sws_scale(img_convert_ctx, f->data, f->linesize, 0, h,
+ avframergb->data, avframergb->linesize);
+ #else
+- img_convert((AVPicture *)avframergb, PIX_FMT_RGB24, (AVPicture*)f, pix_fmt, w, h);
++ img_convert((AVPicture *)avframergb, AV_PIX_FMT_RGB24, (AVPicture*)f, pix_fmt, w, h);
+ #endif
+
+ QImage im;
+diff -ur dvbcut-svn179.orig/src/avframe.h dvbcut-svn179/src/avframe.h
+--- dvbcut-svn179.orig/src/avframe.h 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/avframe.h 2016-11-05 18:14:00.480888996 +1100
+@@ -23,6 +23,7 @@
+
+ extern "C" {
+ #include <avcodec.h>
++#include <libavutil/imgutils.h>
+ #ifdef HAVE_LIB_SWSCALE
+ #include <swscale.h>
+ #endif
+@@ -39,7 +40,7 @@
+ AVFrame *f;
+ void *tobefreed;
+ int w,h,dw;
+- enum PixelFormat pix_fmt;
++ enum AVPixelFormat pix_fmt;
+ #ifdef HAVE_LIB_SWSCALE
+ struct SwsContext *img_convert_ctx;
+ #endif
+@@ -69,7 +70,7 @@
+ {
+ return dw;
+ }
+- enum PixelFormat getpixfmt() const
++ enum AVPixelFormat getpixfmt() const
+ {
+ return pix_fmt;
+ }
+diff -ur dvbcut-svn179.orig/src/buffer.cpp dvbcut-svn179/src/buffer.cpp
+--- dvbcut-svn179.orig/src/buffer.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/buffer.cpp 2016-11-05 18:14:00.483888944 +1100
+@@ -386,7 +386,10 @@
+ }
+ #endif
+ size_t len = mmapsize;
+- if (newpos + len > i->end)
++// dvbcut_off_t + size_t > std::vector<infile>::const_iterator
++// (aka 'long') + (unsigned int) > (unsigned int)
++// if ((newpos > 0) && (static_cast<int>(newpos) + len > i->end))
++ if ((newpos > 0) && (static_cast<unsigned int>(newpos + len) > i->end))
+ len = i->end - newpos;
+ void *ptr = ::mmap(0, len, PROT_READ, MAP_SHARED, i->fd, relpos);
+ if (ptr != MAP_FAILED) {
+@@ -452,7 +455,9 @@
+ needseek = false;
+ }
+ size_t len = size - writepos;
+- if (len > i->end - seekpos)
++// size_t > unsigned int - dvbcut_off_t
++// unsigned int > unsigned int - aka long
++ if ((seekpos > 0) && (len > static_cast<unsigned int>(i->end - seekpos)))
+ len = i->end - seekpos;
+ assert(len > 0);
+ ssize_t n = ::read(i->fd, (char*)d + writepos, len);
+diff -ur dvbcut-svn179.orig/src/dvbcut.cpp dvbcut-svn179/src/dvbcut.cpp
+--- dvbcut-svn179.orig/src/dvbcut.cpp 2016-11-05 19:09:50.368119901 +1100
++++ dvbcut-svn179/src/dvbcut.cpp 2016-11-05 18:14:00.490888821 +1100
+@@ -282,15 +282,15 @@
+ EventListItem::eventtype evt=eli->geteventtype();
+
+ if (evt==EventListItem::start)
+- elemname="start";
++ elemname="start";
+ else if (evt==EventListItem::stop)
+- elemname="stop";
++ elemname="stop";
+ else if (evt==EventListItem::chapter)
+- elemname="chapter";
++ elemname="chapter";
+ else if (evt==EventListItem::bookmark)
+- elemname="bookmark";
++ elemname="bookmark";
+ else
+- continue;
++ continue;
+
+ QDomElement elem=doc.createElement(elemname);
+ elem.setAttribute("picture",eli->getpicture());
+@@ -429,7 +429,8 @@
+ samples = samples>0 ? samples: 1;
+ samples = samples>abs(range) ? abs(range)+1: samples;
+
+- int bestpic = startpic+range, bestnr=0;
++ int bestpic = startpic+range;
++ //, bestnr=0;
+ double bestval = 0.;
+ int dp = range/(samples-1);
+ int ncol = nr*ng*nb;
+@@ -487,7 +488,7 @@
+ if(entropy>bestval) {
+ bestval=entropy;
+ bestpic=pic;
+- bestnr=n;
++// bestnr=n;
+ }
+ }
+ //fprintf(stderr,"choosing sample / frame: %4d / %7d\n!", bestnr, bestpic);
+@@ -517,7 +518,7 @@
+ }
+ }
+
+- std::auto_ptr<exportdialog> expd(new exportdialog(expfilen,this));
++ std::unique_ptr<exportdialog> expd(new exportdialog(expfilen,this));
+ expd->muxercombo->insertItem("MPEG program stream/DVD (DVBCUT multiplexer)");
+ expd->muxercombo->insertItem("MPEG program stream (DVBCUT multiplexer)");
+ expd->muxercombo->insertItem("MPEG program stream/DVD (libavformat)");
+@@ -575,7 +576,7 @@
+ int(lastch/(3600*90000)),
+ int(lastch/(60*90000))%60,
+ int(lastch/90000)%60,
+- int(lastch/90)%1000 );
++ int(lastch/90)%1000);
+ // append chapter marks to lists for plain text / dvdauthor xml-file
+ chapterstring+=chapter;
+ chaptercolumn+=chapter;
+@@ -625,12 +626,12 @@
+ if (child_pid == 0) {
+ ::close(pipe_fds[1]);
+ if (pipe_fds[0] != STDIN_FILENO) {
+- dup2(pipe_fds[0], STDIN_FILENO);
++ dup2(pipe_fds[0], STDIN_FILENO);
+ }
+ //fprintf(stderr, "Executing %s\n", expcmd.c_str()+pos);
+ for (int fd=0; fd<256; ++fd)
+- if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO)
+- ::close(fd);
++ if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO)
++ ::close(fd);
+ execl("/bin/sh", "sh", "-c", expcmd.c_str()+pos, (char *)0);
+ _exit(127);
+ }
+@@ -661,7 +662,7 @@
+
+ // lavfmuxer mux(fmt,*mpg,outfilename);
+
+- std::auto_ptr<muxer> mux;
++ std::unique_ptr<muxer> mux;
+ uint32_t audiostreammask(0);
+
+ for(int a=0;a<mpg->getaudiostreams();++a)
+@@ -673,17 +674,17 @@
+
+ switch(expfmt) {
+ case 1:
+- mux=std::auto_ptr<muxer>(new mpegmuxer(audiostreammask,*mpg,out_file.c_str(),false,0));
++ mux=std::unique_ptr<muxer>(new mpegmuxer(audiostreammask,*mpg,out_file.c_str(),false,0));
+ break;
+ case 2:
+- mux=std::auto_ptr<muxer>(new lavfmuxer("dvd",audiostreammask,*mpg,out_file.c_str()));
++ mux=std::unique_ptr<muxer>(new lavfmuxer("dvd",audiostreammask,*mpg,out_file.c_str()));
+ break;
+ case 3:
+- mux=std::auto_ptr<muxer>(new lavfmuxer("mpegts",audiostreammask,*mpg,out_file.c_str()));
++ mux=std::unique_ptr<muxer>(new lavfmuxer("mpegts",audiostreammask,*mpg,out_file.c_str()));
+ break;
+ case 0:
+ default:
+- mux=std::auto_ptr<muxer>(new mpegmuxer(audiostreammask,*mpg,out_file.c_str()));
++ mux=std::unique_ptr<muxer>(new mpegmuxer(audiostreammask,*mpg,out_file.c_str()));
+ break;
+ }
+
+@@ -718,7 +719,7 @@
+ stoppts=quick_picture_lookup[num].stoppts;
+
+ log->printheading("%d. Exporting %d pictures: %s .. %s",
+- num+1,stoppic-startpic,ptsstring(startpts).c_str(),ptsstring(stoppts).c_str());
++ num+1,stoppic-startpic,ptsstring(startpts).c_str(),ptsstring(stoppts).c_str());
+ mpg->savempg(*mux,startpic,stoppic,savedpic,quick_picture_lookup.back().outpicture,log);
+
+ savedpic=quick_picture_lookup[num].outpicture;
+@@ -728,10 +729,10 @@
+ mux.reset();
+
+ log->printheading("Saved %d pictures (%02d:%02d:%02d.%03d)",savedpic,
+- int(savedtime/(3600*90000)),
+- int(savedtime/(60*90000))%60,
+- int(savedtime/90000)%60,
+- int(savedtime/90)%1000 );
++ int(savedtime/(3600*90000)),
++ int(savedtime/(60*90000))%60,
++ int(savedtime/90000)%60,
++ int(savedtime/90)%1000);
+
+ #ifndef __WIN32__
+ if (child_pid > 0) {
+@@ -1152,7 +1153,7 @@
+ dvbcut_off_t partoffset;
+ int partindex = buf.getfilenum(offset, partoffset);
+ if (partindex == -1)
+- return; // what else can we do?
++ return; // what else can we do?
+
+ mplayer_process=new QProcess(QString("mplayer"));
+ mplayer_process->addArgument("-noconsolecontrols");
+@@ -1298,13 +1299,13 @@
+ fine=false;
+ } else if (relpic<=-settings().jog_threshold) {
+ fine=false;
+- } else
++ } else {
+ fine=true;
++ }
++ if (curpic!=newpic)
++ linslider->setValue(newpic);
+
+- if (curpic!=newpic)
+- linslider->setValue(newpic);
+-
+- fine=false;
++ fine=false;
+ }
+
+
+@@ -1743,81 +1744,89 @@
+ line=line.stripWhiteSpace();
+ }
+ if (line.startsWith(QString("<!DOCTYPE"))
+- || line.startsWith(QString("<?xml"))) {
++ || line.startsWith(QString("<?xml"))) {
+ infile.at(0);
+ QString errormsg;
+ if (domdoc.setContent(&infile,false,&errormsg)) {
+ QDomElement docelem = domdoc.documentElement();
+ if (docelem.tagName() != "dvbcut") {
+ critical("Failed to read project file - dvbcut",
+- QString(filename) + ":\nNot a valid dvbcut project file");
++ QString(filename) + ":\nNot a valid dvbcut project file");
+ fileOpenAction->setEnabled(true);
+ return;
+ }
+- // parse elements, new-style first
+- QDomNode n;
+- filenames.clear();
+- if (!nogui) {
+- // in batch mode CLI-switches have priority!
+- idxfilename.clear();
+- expfilename.clear();
+- }
+- for (n = domdoc.documentElement().firstChild(); !n.isNull(); n = n.nextSibling()) {
+- QDomElement e = n.toElement();
+- if (e.isNull())
+- continue;
+- if (e.tagName() == "mpgfile") {
+- QString qs = e.attribute("path");
+- if (!qs.isEmpty())
+- filenames.push_back((const char*)qs);
+- }
+- else if (e.tagName() == "idxfile" && idxfilename.empty()) {
+- QString qs = e.attribute("path");
+- if (!qs.isEmpty())
+- idxfilename = (const char*)qs;
+- }
+- else if (e.tagName() == "expfile" && expfilename.empty()) {
+- QString qs = e.attribute("path");
+- if (!qs.isEmpty())
+- expfilename = (const char*)qs;
+- qs = e.attribute("format");
++ // parse elements, new-style first
++ QDomNode n;
++ filenames.clear();
++ if (!nogui) {
++ // in batch mode CLI-switches have priority!
++ idxfilename.clear();
++ expfilename.clear();
++ }
++ for (n = domdoc.documentElement().firstChild(); !n.isNull(); n = n.nextSibling()) {
++ QDomElement e = n.toElement();
++ if (e.isNull())
++ continue;
++ if (e.tagName() == "mpgfile") {
++ QString qs = e.attribute("path");
++ if (!qs.isEmpty()) {
++ filenames.push_back((const char*)qs);
++ }
++ }
++ else if (e.tagName() == "idxfile" && idxfilename.empty()) {
++ QString qs = e.attribute("path");
++ if (!qs.isEmpty())
++ {
++ idxfilename = (const char*)qs;
++ }
++ }
++ else if (e.tagName() == "expfile" && expfilename.empty()) {
++ QString qs = e.attribute("path");
++ if (!qs.isEmpty()) {
++ expfilename = (const char*)qs;
++ }
++ qs = e.attribute("format");
+ bool okay=false;
+- if (!qs.isEmpty()) {
++ if (!qs.isEmpty()) {
+ int val = qs.toInt(&okay,0);
+- if(okay) exportformat = val;
++ if(okay) {
++ exportformat = val;
++ }
+ }
+- }
+- }
+- // try old-style project file format
+- if (filenames.empty()) {
+- QString qs = docelem.attribute("mpgfile");
+- if (!qs.isEmpty())
+- filenames.push_back((const char*)qs);
+- }
+- if (idxfilename.empty()) {
+- QString qs = docelem.attribute("idxfile");
+- if (!qs.isEmpty())
+- idxfilename = (const char*)qs;
+- }
+- if (expfilename.empty()) {
+- QString qs = docelem.attribute("expfile");
+- if (!qs.isEmpty())
+- expfilename = (const char*)qs;
+- }
+- // sanity check
+- if (filenames.empty()) {
+- critical("Failed to read project file - dvbcut",
+- QString(filename) + ":\nNo MPEG filename given in project file");
+- fileOpenAction->setEnabled(true);
+- return;
+- }
+- prjfilename = filename;
+- }
+- else {
+- critical("Failed to read project file - dvbcut",
+- QString(filename) + ":\n" + errormsg);
+- fileOpenAction->setEnabled(true);
+- return;
++ }
++ }
++ // try old-style project file format
++ if (filenames.empty()) {
++ QString qs = docelem.attribute("mpgfile");
++ if (!qs.isEmpty()) {
++ filenames.push_back((const char*)qs);
++ }
++ }
++ if (idxfilename.empty()) {
++ QString qs = docelem.attribute("idxfile");
++ if (!qs.isEmpty()) {
++ idxfilename = (const char*)qs;
++ }
++ if (expfilename.empty()) {
++ QString qs = docelem.attribute("expfile");
++ if (!qs.isEmpty())
++ expfilename = (const char*)qs;
++ }
++ // sanity check
++ if (filenames.empty()) {
++ critical("Failed to read project file - dvbcut",
++ QString(filename) + ":\nNo MPEG filename given in project file");
++ fileOpenAction->setEnabled(true);
++ return;
++ }
++ prjfilename = filename;
++ }
++ else {
++ critical("Failed to read project file - dvbcut",
++ QString(filename) + ":\n" + errormsg);
++ fileOpenAction->setEnabled(true);
++ return;
++ }
+ }
+ }
+ }
+@@ -1849,34 +1858,38 @@
+ if (idxfilename.empty()) {
+ idxfilename = filename + ".idx";
+ if (!nogui) {
+- /*
+- * BEWARE! UGLY HACK BELOW!
+- *
+- * In order to circumvent the QFileDialog's stupid URL parsing,
+- * we need to first change to the directory and then pass the
+- * filename as a relative file: URL. Otherwise, filenames that
+- * contain ":" will not be handled correctly. --mr
+- */
+- QUrl u;
+- u.setProtocol(QString("file"));
+- u.setPath(QString(idxfilename));
+- if (chdir((const char*)u.dirPath()) == -1) chdir("/");
+- QString relname = QString("file:") + u.fileName();
+- QString s=QFileDialog::getSaveFileName(
+- relname,
+- settings().idxfilter,
+- this,
+- "Choose index file...",
+- "Choose the name of the index file" );
+- if (!s) {
+- delete mpg;
+- mpg=0;
+- fileOpenAction->setEnabled(true);
+- return;
+- }
+- idxfilename=(const char*)s;
+- // it's now a relative name that will be canonicalized again soon
+- }
++ /*
++ * BEWARE! UGLY HACK BELOW!
++ *
++ * In order to circumvent the QFileDialog's stupid URL parsing,
++ * we need to first change to the directory and then pass the
++ * filename as a relative file: URL. Otherwise, filenames that
++ * contain ":" will not be handled correctly. --mr
++ */
++ QUrl u;
++ u.setProtocol(QString("file"));
++ u.setPath(QString(idxfilename));
++ if (chdir((const char*)u.dirPath()) == -1) {
++ if(chdir("/") == -1) {
++ critical("Directory wasn't found, and attempting to use / failed.", errormessage);
++ }
++ }
++ QString relname = QString("file:") + u.fileName();
++ QString s=QFileDialog::getSaveFileName(
++ relname,
++ settings().idxfilter,
++ this,
++ "Choose index file...",
++ "Choose the name of the index file" );
++ if (!s) {
++ delete mpg;
++ mpg=0;
++ fileOpenAction->setEnabled(true);
++ return;
++ }
++ idxfilename=(const char*)s;
++ // it's now a relative name that will be canonicalized again soon
++ }
+ }
+
+ make_canonical(idxfilename);
+@@ -1936,7 +1949,7 @@
+ delete mpg;
+ mpg=0;
+ critical("Error creating index - dvbcut",
+- QString("Cannot create index for\n")+filename+":\n"+errorstring);
++ QString("Cannot create index for\n")+filename+":\n"+errorstring);
+ fileOpenAction->setEnabled(true);
+ return;
+ } else if (!errorstring.empty()) {
+@@ -1948,7 +1961,7 @@
+ delete mpg;
+ mpg=0;
+ critical("Invalid MPEG file - dvbcut",
+- QString("The chosen file\n")+filename+"\ndoes not contain any video");
++ QString("The chosen file\n")+filename+"\ndoes not contain any video");
+ fileOpenAction->setEnabled(true);
+ return;
+ }
+@@ -2005,35 +2018,35 @@
+
+ if (!domdoc.isNull()) {
+ QDomElement e;
+- for (QDomNode n=domdoc.documentElement().firstChild();!n.isNull();n=n.nextSibling())
++ for (QDomNode n=domdoc.documentElement().firstChild();!n.isNull();n=n.nextSibling()) {
+ if (!(e=n.toElement()).isNull()) {
+- EventListItem::eventtype evt;
+- if (e.tagName()=="start")
+- evt=EventListItem::start;
+- else if (e.tagName()=="stop")
+- evt=EventListItem::stop;
+- else if (e.tagName()=="chapter")
+- evt=EventListItem::chapter;
+- else if (e.tagName()=="bookmark")
+- evt=EventListItem::bookmark;
+- else
+- continue;
+- bool okay=false;
+- int picnum;
+- QString str=e.attribute("picture","-1");
+- if (str.contains(':') || str.contains('.')) {
+- okay=true;
+- picnum=string2pts(str)/getTimePerFrame();
+- }
+- else
+- picnum=str.toInt(&okay,0);
+- if (okay && picnum>=0 && picnum<pictures) {
+- new EventListItem(eventlist,imgp->getimage(picnum),evt,picnum,(*mpg)[picnum].getpicturetype(),(*mpg)[picnum].getpts()-firstpts);
+- qApp->processEvents();
++ EventListItem::eventtype evt;
++ if (e.tagName()=="start")
++ evt=EventListItem::start;
++ else if (e.tagName()=="stop")
++ evt=EventListItem::stop;
++ else if (e.tagName()=="chapter")
++ evt=EventListItem::chapter;
++ else if (e.tagName()=="bookmark")
++ evt=EventListItem::bookmark;
++ else
++ continue;
++ bool okay=false;
++ int picnum;
++ QString str=e.attribute("picture","-1");
++ if (str.contains(':') || str.contains('.')) {
++ okay=true;
++ picnum=string2pts(str)/getTimePerFrame();
++ }
++ else
++ picnum=str.toInt(&okay,0);
++ if (okay && picnum>=0 && picnum<pictures) {
++ new EventListItem(eventlist,imgp->getimage(picnum),evt,picnum,(*mpg)[picnum].getpicturetype(),(*mpg)[picnum].getpts()-firstpts);
++ qApp->processEvents();
++ }
+ }
+ }
+ }
+-
+ update_quick_picture_lookup_table();
+
+ fileOpenAction->setEnabled(true);
+@@ -2169,14 +2182,14 @@
+ incr = settings().wheel_increments[incr];
+ if (incr != 0) {
+ bool save = fine;
+- // use fine positioning if incr is small
++ // use fine positioning if incr is small
+ fine = (incr < 0 ? -incr : incr) < settings().wheel_threshold;
+- // Note: delta is a multiple of 120 (see Qt documentation)
++ // Note: delta is a multiple of 120 (see Qt documentation)
+ int newpos = curpic - (delta * incr) / settings().wheel_delta;
+ if (newpos < 0)
+- newpos = 0;
+- else if (newpos >= pictures)
+- newpos = pictures - 1;
++ newpos = 0;
++ else if (newpos >= pictures)
++ newpos = pictures - 1;
+ linslider->setValue(newpos);
+ fine = save;
+ }
+@@ -2286,9 +2299,9 @@
+ goinput->setText(QString::number(curpic));
+ goinput2->setText(QString::number(outpic));
+
+- int res=idx.getresolution(); // are found video resolutions stored in index?
+- if (res) {
+- // new index with resolution bits set and lookup table at the end
++ int res=idx.getresolution(); // are found video resolutions stored in index?
++ if (res) {
++ // new index with resolution bits set and lookup table at the end
+ picinfolabel->setText(QString::number(mpg->getwidth(res)) + "x"
+ + QString::number(mpg->getheight(res)));
+ } else {
+@@ -2335,11 +2348,11 @@
+ const EventListItem &eli=*static_cast<const EventListItem*>(item);
+ switch (eli.geteventtype()) {
+ case EventListItem::start:
+- if (startpic<0 || (start_bof && startpic==0 && !realzero)) {
++ if (startpic<0 || (start_bof && startpic==0 && !realzero)) {
+ startpic=eli.getpicture();
+ startpts=eli.getpts();
+ if (startpic==0)
+- realzero=true;
++ realzero=true;
+ // did we have a chapter in the eventlist directly before?
+ if(lastchapter==startpic)
+ chapterlist.push_back(outpts);
+@@ -2359,9 +2372,9 @@
+ break;
+ case EventListItem::chapter:
+ lastchapter=eli.getpicture();
+- if (startpic>=0)
+- chapterlist.push_back(eli.getpts()-startpts+outpts);
+- break;
++ if (startpic>=0)
++ chapterlist.push_back(eli.getpts()-startpts+outpts);
++ break;
+ default:
+ break;
+ }
+diff -ur dvbcut-svn179.orig/src/index.cpp dvbcut-svn179/src/index.cpp
+--- dvbcut-svn179.orig/src/index.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/index.cpp 2016-11-05 18:14:00.488888856 +1100
+@@ -308,7 +308,7 @@
+ pts_t ptsdelta = pts - p[lastiframe].getpts();
+ int pdelta = pictures - lastiframe + seqnr - p[lastiframe].getsequencenumber();
+ if (pdelta * framepts < ptsdelta)
+- fprintf(stderr, "missing frames in GOP (%d, %d): %lld\n",
++ fprintf(stderr, "missing frames in GOP (%d, %d): %ld\n",
+ lastiframe, pictures, ptsdelta / framepts - pdelta);
+ }
+ lastiframe = pictures;
+diff -ur dvbcut-svn179.orig/src/lavfmuxer.cpp dvbcut-svn179/src/lavfmuxer.cpp
+--- dvbcut-svn179.orig/src/lavfmuxer.cpp 2016-11-05 19:09:50.374119795 +1100
++++ dvbcut-svn179/src/lavfmuxer.cpp 2016-11-05 18:14:00.497888699 +1100
+@@ -48,6 +48,7 @@
+ // maybe: AVFormatContext::audio_preload but no direct access.
+ // AVOptions
+ // iformat
++fprintf(stderr," lavfmuxer: need code: mux_rate\n");
+ #else
+ avfc->preload= (int)(.5*AV_TIME_BASE);
+ avfc->mux_rate=10080000;
+@@ -67,7 +68,8 @@
+ mpg.setvideoencodingparameters();
+ s->codec=mpg.getavcc(VIDEOSTREAM);
+ s->codec->rc_buffer_size = 224*1024*8;
+-#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(21<<8)+0)
++#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52, 21, 0)
++fprintf(stderr," lavfmuxer: b4 sample_aspect_ratio\n");
+ s->sample_aspect_ratio = s->codec->sample_aspect_ratio;
+ #endif
+
+@@ -81,24 +83,37 @@
+ if (s->codec)
+ av_free(s->codec);
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
+-// todo: what here ?
+-// maybe need non NULL passed
+-// AVCodecContext* avcodec_alloc_context3 ( const AVCodec * codec )
+- s->codec = avcodec_alloc_context3(NULL);
+-
+-// attribute_deprecated void avcodec_get_context_defaults ( AVCodecContext * s )
+- avcodec_get_context_defaults3(s->codec, NULL);
+-
++/*
++AVCodecContext* avcodec_alloc_context (void)
++Deprecated: use avcodec_alloc_context3():
++AVCodecContext* avcodec_alloc_context3(const AVCodec * codec)
++*/
++fprintf(stderr," lavfmuxer: b4 avcodec_alloc_context3\n");
++ AVCodec* avcodec = avcodec_find_decoder(AV_CODEC_ID_AC3);
++ s->codec = avcodec_alloc_context3(avcodec);
++/*
++void avcodec_get_context_defaults(AVCodecContext * s)
++Deprecated: use avcodec_get_context_defaults3:
++int avcodec_get_context_defaults3(AVCodecContext * s, const AVCodec * codec)
++*/
++fprintf(stderr," lavfmuxer: b4 avcodec_get_context_defaults3\n");
++ int getContext_result = avcodec_get_context_defaults3(s->codec, avcodec);
++ if(getContext_result <= 10) { // todo just testing this works
++ fprintf(stderr, " avcodec_get_context_defaults3 returned=%d\n", getContext_result);
++ }
+ #else
++fprintf(stderr," lavfmuxer: b4 avcodec_get_context_defaults3.alt\n");
+ s->codec = avcodec_alloc_context();
+ avcodec_get_context_defaults(s->codec);
+ #endif
+- s->codec->codec_type=AVMEDIA_TYPE_AUDIO;
++ s->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ s->codec->codec_id = (mpg.getstreamtype(astr)==streamtype::ac3audio) ?
+- CODEC_ID_AC3 : CODEC_ID_MP2;
++ AV_CODEC_ID_AC3 : AV_CODEC_ID_MP2;
++fprintf(stderr," lavfmuxer: b4 rc_buffer_size\n");
+ s->codec->rc_buffer_size = 224*1024*8;
+
+ // Must read some packets to get codec parameters
++fprintf(stderr," lavfmuxer: b4 newstream\n");
+ streamhandle sh(mpg.getinitialoffset());
+ streamdata *sd=sh.newstream(astr,mpg.getstreamtype(astr),mpg.istransportstream());
+
+@@ -107,46 +122,70 @@
+ break;
+
+ if (sd->getitemlistsize() > 1) {
+-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
+-// todo:
+-//int avcodec_open2 ( AVCodecContext * avctx,
+-// const AVCodec * codec,
+-// AVDictionary ** options
+-// )
+- if (!avcodec_open2(s->codec,
+- avcodec_find_decoder(s->codec->codec_id), NULL)) {
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
++/*
++int avcodec_open (AVCodecContext * avctx, AVCodec * codec)
++Deprecated: use avcodec_open2(): doxygen/0.7/
++int avcodec_open2(AVCodecContext * avctx, const AVCodec * codec, AVDictionary ** options)
++*/
++fprintf(stderr," lavfmuxer: b4 codec_options\n");
++ AVDictionary *codec_options = NULL;
++ if (avcodec_open2(s->codec,
++ avcodec_find_decoder(s->codec->codec_id), &codec_options) == 0) {
+ #else
+ if (!avcodec_open(s->codec,
+ avcodec_find_decoder(s->codec->codec_id))) {
+ #endif
+
+-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 18, 0)
+-// todo:
+-// FF_API_OLD_DECODE_AUDIO is not defined, so need to work out how to
+-// calc frame_size, or if decode_audio3 needs it
+-// used to be AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000
+-// trying that
+- int16_t samples[192000/sizeof(int16_t)];
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 40, 0)
++/*
++AVCODEC_MAX_AUDIO_FRAME_SIZE is deprecated.
++*/
++#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
++ int16_t samples[MAX_AUDIO_FRAME_SIZE/sizeof(int16_t)];
+ #else
+ int16_t samples[AVCODEC_MAX_AUDIO_FRAME_SIZE/sizeof(int16_t)];
+ #endif
++fprintf(stderr," lavfmuxer: b4 frame_size\n");
+ int frame_size=sizeof(samples);
+ //fprintf(stderr, "** decode audio size=%d\n", sd->inbytes());
+
+-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++/*
++int avcodec_decode_audio (AVCodecContext * avctx, int16_t * samples,
++ int * frame_size_ptr, uint8_t * buf, int buf_size);
++Deprecated: Use avcodec_decode_audio2() instead.
++int avcodec_decode_audio2(AVCodecContext * avctx, int16_t * samples,
++ int * frame_size_ptr, uint8_t * buf, int buf_size);
++Deprecated: Use avcodec_decode_audio3() instead.
++int avcodec_decode_audio3(AVCodecContext * avctx, int16_t * samples,
++ int * frame_size_ptr, AVPacket * avpkt)
++Deprecated: Use avcodec_decode_audio4 instead.
++int avcodec_decode_audio4 (AVCodecContext *avctx, AVFrame *frame,
++ int * got_frame_ptr, const AVPacket * avpkt)
++Deprecated:
++ Use avcodec_send_packet() and avcodec_receive_frame():
++int avcodec_send_packet(AVCodecContext * avctx, const AVPacket * avpkt)
++int avcodec_receive_frame(AVCodecContext * avctx, AVFrame * frame)
++*/
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 25, 0)
+ AVPacket avpkt;
++fprintf(stderr," lavfmuxer: b4 av_init_packet\n");
+ av_init_packet(&avpkt);
+ avpkt.data = (uint8_t*)sd->getdata();
+ avpkt.size = sd->inbytes();
+ // HACK for CorePNG to decode as normal PNG by default
+ avpkt.flags = AV_PKT_FLAG_KEY;
+- avcodec_decode_audio3(s->codec,samples,&frame_size, &avpkt);
+-#elif LIBAVCODEC_VERSION_INT >= ((52<<16)+(0<<8)+0)
+- avcodec_decode_audio2(s->codec,samples,&frame_size,
+- (uint8_t*) sd->getdata(),sd->inbytes());
++ AVFrame * decoded_frame;
++ int got_frame_ptr;
++fprintf(stderr," lavfmuxer: b4 avcodec_decode_audio4\n");
++ avcodec_decode_audio4(s->codec, decoded_frame, &got_frame_ptr, &avpkt);
++// avcodec_decode_audio3(s->codec, samples, &frame_size, &avpkt);
++#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
++ avcodec_decode_audio2(s->codec, samples, &frame_size,
++ (uint8_t*) sd->getdata(), sd->inbytes());
+ #else
+- avcodec_decode_audio(s->codec,samples,&frame_size,
+- (uint8_t*) sd->getdata(),sd->inbytes());
++ avcodec_decode_audio(s->codec, samples, &frame_size,
++ (uint8_t*) sd->getdata(), sd->inbytes());
+ #endif
+ avcodec_close(s->codec);
+ }
+@@ -157,6 +196,7 @@
+
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
+ // error: 'av_set_parameters' was not declared in this scope
++fprintf(stderr," lavfmuxer: b4 avio_open\n");
+ if (!(fmt->flags & AVFMT_NOFILE)&&(avio_open(&avfc->pb, filename, AVIO_FLAG_WRITE) < 0)) {
+ #else
+ if ((av_set_parameters(avfc, NULL) < 0) || (!(fmt->flags & AVFMT_NOFILE)&&(url_fopen(&avfc->pb, filename, URL_WRONLY) < 0))) {
+@@ -170,6 +210,7 @@
+ // maybe: AVFormatContext::audio_preload but no direct access.
+ // AVOptions
+ // iformat
++fprintf(stderr," lavfmuxer: needcode: mux_rate\n");
+ #else
+ avfc->preload= (int)(.5*AV_TIME_BASE);
+ avfc->mux_rate=10080000;
+@@ -177,9 +218,12 @@
+ avfc->max_delay= (int)(.7*AV_TIME_BASE);
+
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++fprintf(stderr," lavfmuxer: b4: av_dump_format\n");
+ av_dump_format(avfc, 0, filename, 1);
+ fileopened=true;
++fprintf(stderr," lavfmuxer: b4: avformat_write_header\n");
+ avformat_write_header(avfc, NULL);
++fprintf(stderr," lavfmuxer: after: avformat_write_header\n");
+ #else
+ dump_format(avfc, 0, filename, 1);
+ fileopened=true;
+@@ -196,7 +240,7 @@
+ if (!(fmt->flags & AVFMT_NOFILE))
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
+ avio_close(avfc->pb);
+-#elif LIBAVFORMAT_VERSION_INT >= ((52<<16)+(0<<8)+0)
++#elif LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52, 0, 0)
+ url_fclose(avfc->pb);
+ #else
+ url_fclose(&avfc->pb);
+diff -ur dvbcut-svn179.orig/src/main.cpp dvbcut-svn179/src/main.cpp
+--- dvbcut-svn179.orig/src/main.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/main.cpp 2016-11-05 18:14:00.488888856 +1100
+@@ -54,7 +54,7 @@
+ void
+ usage_exit(int rv=1) {
+ fprintf(stderr,
+- "Usage ("VERSION_STRING"):\n"
++ " Usage (" VERSION_STRING"):\n"
+ " %s -generateidx [-idx <idxfilename>] [<mpgfilename> ...]\n"
+ " %s -batch [ OPTIONS ] <prjfilename> | <mpgfilename> ...\n\n"
+ "OPTIONS: -cut 4:3|16:9|TS|TS2|<list>, -exp <expfilename>,\n"
+diff -ur dvbcut-svn179.orig/src/mpegmuxer.cpp dvbcut-svn179/src/mpegmuxer.cpp
+--- dvbcut-svn179.orig/src/mpegmuxer.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/mpegmuxer.cpp 2016-11-05 18:14:00.489888838 +1100
+@@ -640,8 +640,8 @@
+ }
+
+ if (len) {
+- fprintf(stderr,"str=%d len=%d aulist.size=%d packlist.size=%d\n",
+- str,len,s->aulist.size(),s->packlist.size());
++ fprintf(stderr,"str=%d len=%d aulist.size=%lu packlist.size=%lu\n",
++ str, len, s->aulist.size(), s->packlist.size());
+ assert(len==0);
+ }
+ }
+Only in dvbcut-svn179/src: mpegmuxer.cpp.c11
+Only in dvbcut-svn179/src: mpegmuxer.o
+diff -ur dvbcut-svn179.orig/src/mpgfile.cpp dvbcut-svn179/src/mpgfile.cpp
+--- dvbcut-svn179.orig/src/mpgfile.cpp 2016-11-05 19:09:50.373119813 +1100
++++ dvbcut-svn179/src/mpgfile.cpp 2016-11-05 18:14:00.491888803 +1100
+@@ -259,9 +259,9 @@
+ S->id=vid;
+ S->allocavcc();
+ S->avcc->codec_type=AVMEDIA_TYPE_VIDEO;
+- S->avcc->codec_id=CODEC_ID_MPEG2VIDEO;
+- S->dec=avcodec_find_decoder(CODEC_ID_MPEG2VIDEO);
+- S->enc=avcodec_find_encoder(CODEC_ID_MPEG2VIDEO);
++ S->avcc->codec_id=AV_CODEC_ID_MPEG2VIDEO;
++ S->dec=avcodec_find_decoder(AV_CODEC_ID_MPEG2VIDEO);
++ S->enc=avcodec_find_encoder(AV_CODEC_ID_MPEG2VIDEO);
+ S->type=streamtype::mpeg2video;
+ }
+
+@@ -629,7 +629,7 @@
+ {
+
+ for(it=sd->itemlist().begin();it!=sd->itemlist().end();++it)
+- fprintf(stderr," fileposition:%lld/%d bufferposition:%d flags:%x pts:%s\n",
++ fprintf(stderr," fileposition:%ld/%d bufferposition:%d flags:%x pts:%s\n",
+ it->fileposition.packetposition(),it->fileposition.packetoffset(),
+ it->bufferposition,it->flags,ptsstring(it->pts).c_str());
+
+@@ -638,7 +638,7 @@
+
+ for(int i=0;i<MAXAVSTREAMS;++i)
+ if (sh.stream[i])
+- fprintf(stderr,"stream %d%s, itemlist.size():%d\n",
++ fprintf(stderr,"stream %d%s, itemlist.size():%lu\n",
+ i,(sh.stream[i]==sd)?"*":"",sh.stream[i]->itemlist().size());
+
+ abort();
+@@ -725,6 +725,11 @@
+ {
+ u_int8_t *buf=(u_int8_t*)m2v.writeptr();
+ int out;
++ int got_packet;
++ AVPacket avpkt;
++ av_init_packet(&avpkt);
++ avpkt.data = NULL;
++ avpkt.size = 0;
+
+ if (!framelist.empty())
+ {
+@@ -733,13 +738,27 @@
+ f->pts=idx[idx.indexnr(start+p)].getpts()-startpts;
+ f->coded_picture_number=f->display_picture_number=p;
+ f->key_frame=(p==0)?1:0;
+-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 24, 0)
+ f->pict_type=(p==0)?AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
++/*
++int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size
++ , const AVFrame *pict)
++use avcodec_encode_video2() instead:
++int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt
++ , const AVFrame *frame, int *got_packet_ptr)
++ &f ?
++*/
++ out = avcodec_encode_video2(avcc, &avpkt, f, &got_packet);
++// was: out = avcodec_encode_video2(avcc, buf, m2v.getsize(), f);
+ #else
++ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(50, 0, 0)
++ f->pict_type=(p==0)?AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
++ #else
+ f->pict_type=(p==0)?FF_I_TYPE:FF_P_TYPE;
+-#endif
++ #endif
+ out = avcodec_encode_video(avcc, buf,
+ m2v.getsize(), f);
++#endif
+
+ delete framelist.front();
+ framelist.pop_front();
+@@ -751,8 +770,11 @@
+ else
+ {
+ fprintf(stderr,"trying to call avcodec_encode_video with frame=0\n");
+- out = avcodec_encode_video(avcc, buf,
+- m2v.getsize(), 0);
++/*
++
++*/
++ out = avcodec_encode_video2(avcc, &avpkt, 0, &got_packet);
++// was: out = avcodec_encode_video(avcc, buf, m2v.getsize(), 0);
+ fprintf(stderr,"...back I am.\n");
+
+ if (out<=0)
+@@ -763,8 +785,18 @@
+ pts_t viddts=mux.getdts(VIDEOSTREAM);
+ mux.setdts(VIDEOSTREAM,vidpts);
+ fixtimecode(buf,out,vidpts);
++/*
++AVCodecContext::coded_frame
++use the quality factor packet side data instead.
++*/
++ int sidedata_key_frame = 0;
++ //if (avpkt.flags & AV_PKT_FLAG_KEY)
++ sidedata_key_frame = avpkt.flags & AV_PKT_FLAG_KEY;
++ fprintf(stderr, "sidedata_key_frame=%hhu\n", sidedata_key_frame);
+ mux.putpacket(VIDEOSTREAM,buf,out,vidpts,viddts,
+- (avcc->coded_frame && avcc->coded_frame->key_frame)?MUXER_FLAG_KEY:0 );
++ (sidedata_key_frame)?MUXER_FLAG_KEY:0 );
++// orig: mux.putpacket(VIDEOSTREAM,buf,out,vidpts,viddts,
++// (avcc->coded_frame && avcc->coded_frame->key_frame)?MUXER_FLAG_KEY:0 );
+ ++outpicture;
+
+ if (log && savepics>0)
+diff -ur dvbcut-svn179.orig/src/stream.h dvbcut-svn179/src/stream.h
+--- dvbcut-svn179.orig/src/stream.h 2016-11-05 19:09:50.373119813 +1100
++++ dvbcut-svn179/src/stream.h 2016-11-05 18:14:00.479889014 +1100
+@@ -68,11 +68,31 @@
+ avcc->rc_min_rate=9500000;
+ avcc->rc_max_rate=9500000;
+ avcc->rc_buffer_size=224*1024*8;
+- avcc->rc_buffer_aggressivity=1.0;
++/* ffmpeg info:
++https://libav.org/documentation/doxygen/master/structAVCodecContext.html
++attribute_deprecated float AVCodecContext::rc_buffer_aggressivity
++
++Deprecated:
++ use encoder private options instead
++ Also:
++http://video.stackexchange.com/questions/18371/avconv-what-are-the-mpegvideo-private-options
++.. "rc_buf_aggressivity", "currently useless",
++*/
++// assume default is OK, comment out.
++// avcc->rc_buffer_aggressivity=1.0;
+ avcc->rc_initial_buffer_occupancy = avcc->rc_buffer_size*3/4;
+ avcc->qmax=2;
+ avcc->mb_lmax= FF_QP2LAMBDA * 2;
+- avcc->lmax= FF_QP2LAMBDA * 2;
++/* ffmpeg info:
++https://libav.org/documentation/doxygen/master/structAVCodecContext.html
++attribute_deprecated int AVCodecContext::lmax
++
++Deprecated:
++ use encoder private options instead
++.. "lmax", "maximum Lagrange factor (VBR)",
++*/
++// assume default is OK, so just comment out.
++// avcc->lmax= FF_QP2LAMBDA * 2;
+ if (interlaced)
+ avcc->flags |= CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME;
+ }
+diff -ur dvbcut-svn179.orig/src/tsfile.cpp dvbcut-svn179/src/tsfile.cpp
+--- dvbcut-svn179.orig/src/tsfile.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/tsfile.cpp 2016-11-05 18:14:00.490888821 +1100
+@@ -137,7 +137,8 @@
+ int pd=buf.providedata(packetsize,packetpos);
+ if (pd<0)
+ return pd;
+- if (pd<packetsize)
++ // int < unsigned int
++ if (static_cast<unsigned int>(pd) < packetsize)
+ return returnvalue;
+ }
+
+@@ -349,7 +350,7 @@
+ && bnum<TF5XXXPVR_MAX) {
+ // bookmark is stored in 128 resp. 94kbyte units
+ bookmark*=unit;
+- if(verbose) fprintf(stderr,"BOOKMARK[%d] = %lld\n",bnum,bookmark);
++ if(verbose) fprintf(stderr,"BOOKMARK[%d] = %ld\n",bnum,bookmark);
+ // fill bookmark vector with byte positions
+ byte_bookmarks.push_back(bookmark);
+ bnum++;
+@@ -403,7 +404,7 @@
+ // changed byte order compared to old receivers!?!
+ while ((bookmark=(buffer[boff+3]<<24)|(buffer[boff+2]<<16)|(buffer[boff+1]<<8)|buffer[boff])
+ && bnum<TF7700HDPVR_MAX) {
+- if(verbose) fprintf(stderr,"BOOKMARK[%d] = %lld\n",bnum,bookmark);
++ if(verbose) fprintf(stderr,"BOOKMARK[%d] = %ld\n",bnum,bookmark);
+ // bookmark is stored in seconds now, but we'll use full pts!
+ bookmark*=unit;
+ // fill bookmark vector with times
+@@ -412,7 +413,7 @@
+ boff+=4;
+ }
+ } else // receiver model identified but file to short!
+- fprintf(stderr,"ADD-File probabely corrupted (%dbytes to short), discarding bookmarks!\n",TF7700HDPVR_LEN-len);
++ fprintf(stderr,"ADD-File probably corrupted (%ld bytes too short), discarding bookmarks!\n",TF7700HDPVR_LEN-len);
+
+ // terminate
+ free(buffer);
diff --git a/dvbcut.spec b/dvbcut.spec
index fba7028..51c845b 100644
--- a/dvbcut.spec
+++ b/dvbcut.spec
@@ -7,7 +7,7 @@
Name: dvbcut
Version: 0.6.1
-Release: 18.svn%{svnrev}%{?dist}
+Release: 19.svn%{svnrev}%{?dist}
Summary: Clip and convert DVB transport streams to MPEG2 program streams
Group: Applications/Multimedia
@@ -32,6 +32,7 @@ Patch6: %{name}-179-vs-ubuntu-12.04.diff
Patch7: %{name}-svn179-ffmpeg-0.11.1.patch
Patch8: %{name}-svn179-ffmpeg-2.0-compatibility.patch
Patch9: %{name}-svn179-ffmpeg-2.4.3-compatibility.patch
+Patch10: %{name}-svn179-ffmpeg-3.0.3-compatibility.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: autoconf
@@ -70,6 +71,7 @@ dvbcut can use Mplayer if available.
%patch7 -p1 -b .ffmpeg-0.11.1
%patch8 -b .ffmpeg-2.0
%patch9 -p1 -b .ffmpeg-2.4.3
+%patch10 -p1 -b .ffmpeg-3.0.3
# Fix QTDIR libs in configure
sed -i 's,$QTDIR/$mr_libdirname,$QTDIR/lib,' configure.in
@@ -139,6 +141,16 @@ update-desktop-database &> /dev/null || :
%changelog
+* Sat Nov 5 2016 David Timms <iinet.net.au at dtimms> - 0.6.1-19.svn179
+- rebuild for ffmpeg-3.0.3
+- add combined patch covering:
+- ffmpeg-3.0.3 for removed deprecated definitions and functions.
+- signed-unsigned comparison warnings.
+- whitespace alignment warnings.
+- replace tabs with spaces to match existing source files.
+- c++ compiler c11 fixes (not compatble with <=F23).
+- unused variables.
+
* Mon Oct 20 2014 David Timms <iinet.net.au at dtimms> - 0.6.1-18.svn179
- add patch for ffmpeg-2.4.3 for dropped av_new_stream().
8 years
[dvbcut] Revert "package is unmaintained - rhbz#4212"
by Nicolas Chauvet
commit bbf1a250cbbaee2054e3acc1dbf23b978b0c840b
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Mon Nov 21 12:11:04 2016 +0100
Revert "package is unmaintained - rhbz#4212"
This reverts commit 44561199caf91178e56679265bf5be901b44c39b.
.gitignore | 1 +
dead.package | 1 -
dvbcut-179-vs-ubuntu-12.04.diff | 142 ++++++++++
dvbcut-fix-help-path.patch | 11 +
dvbcut-servicemenu.desktop | 15 ++
dvbcut-snapshot.sh | 47 ++++
dvbcut-svn176-desktop-additions.patch | 21 ++
dvbcut-svn176-fix-help-install-path.patch | 11 +
dvbcut-svn176-fix-make-install.patch | 29 +++
dvbcut-svn179-ffmpeg-0.11.1.patch | 88 +++++++
dvbcut-svn179-ffmpeg-2.0-compatibility.patch | 101 ++++++++
dvbcut-svn179-ffmpeg-2.4.3-compatibility.patch | 22 ++
dvbcut.spec | 346 +++++++++++++++++++++++++
sources | 1 +
14 files changed, 835 insertions(+), 1 deletion(-)
---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..112f430
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+dvbcut-svn179.tar.bz2
diff --git a/dvbcut-179-vs-ubuntu-12.04.diff b/dvbcut-179-vs-ubuntu-12.04.diff
new file mode 100644
index 0000000..202a9de
--- /dev/null
+++ b/dvbcut-179-vs-ubuntu-12.04.diff
@@ -0,0 +1,142 @@
+Index: src/lavfmuxer.h
+===================================================================
+--- src/lavfmuxer.h (revision 179)
++++ src/lavfmuxer.h (working copy)
+@@ -73,7 +73,7 @@
+ avp.dts=dts;
+ avp.stream_index=st[str].stream_index;
+ if (flags & MUXER_FLAG_KEY)
+- avp.flags |= PKT_FLAG_KEY;
++ avp.flags |= AV_PKT_FLAG_KEY;
+
+ int rv=av_interleaved_write_frame(avfc,&avp);
+
+Index: src/mpgfile.cpp
+===================================================================
+--- src/mpgfile.cpp (revision 179)
++++ src/mpgfile.cpp (working copy)
+@@ -154,15 +154,19 @@
+
+ if (!firstsequence || idx[streampic].getsequencenumber()>=seqnr)
+ {
+- const uint8_t *data=(const uint8_t*)sd->getdata();
++ AVPacket avpkt;
++ av_init_packet(&avpkt);
++ avpkt.data = (uint8_t*)sd->getdata();
++ avpkt.size = bytes;
++ // HACK for CorePNG to decode as normal PNG by default
++ avpkt.flags = AV_PKT_FLAG_KEY;
+ int frameFinished=0;
+
+- int decodebytes=bytes;
+- while (decodebytes>0)
++ while (avpkt.size>0)
+ {
+ frameFinished=0;
+- int bytesDecoded=avcodec_decode_video(S->avcc, avf, &frameFinished,
+- (uint8_t*) data, decodebytes);
++ int bytesDecoded=avcodec_decode_video2(S->avcc, avf, &frameFinished,
++ &avpkt);
+ if (bytesDecoded<0)
+ {
+ fprintf(stderr,"libavcodec error while decoding frame #%d\n",pic);
+@@ -170,8 +174,8 @@
+ return;
+ }
+
+- data+=bytesDecoded;
+- decodebytes-=bytesDecoded;
++ avpkt.data+=bytesDecoded;
++ avpkt.size-=bytesDecoded;
+
+ if (frameFinished)
+ {
+@@ -184,7 +188,7 @@
+ if (pic>=stop)
+ {
+ frameFinished=0;
+- decodebytes=0;
++ avpkt.size=0;
+ break;
+ }
+ }
+@@ -200,8 +204,14 @@
+
+ if (pic < stop)
+ {
++ AVPacket avpkt;
++ av_init_packet(&avpkt);
++ avpkt.data = NULL;
++ avpkt.size = 0;
++ // HACK for CorePNG to decode as normal PNG by default
++ avpkt.flags = AV_PKT_FLAG_KEY;
+ int frameFinished=0;
+- avcodec_decode_video(S->avcc, avf, &frameFinished, NULL, 0);
++ avcodec_decode_video2(S->avcc, avf, &frameFinished, &avpkt);
+ if (frameFinished)
+ {
+ if (last_cpn!=avf->coded_picture_number)
+@@ -248,7 +258,7 @@
+ stream *S=&s[VIDEOSTREAM];
+ S->id=vid;
+ S->allocavcc();
+- S->avcc->codec_type=CODEC_TYPE_VIDEO;
++ S->avcc->codec_type=AVMEDIA_TYPE_VIDEO;
+ S->avcc->codec_id=CODEC_ID_MPEG2VIDEO;
+ S->dec=avcodec_find_decoder(CODEC_ID_MPEG2VIDEO);
+ S->enc=avcodec_find_encoder(CODEC_ID_MPEG2VIDEO);
+Index: src/lavfmuxer.cpp
+===================================================================
+--- src/lavfmuxer.cpp (revision 179)
++++ src/lavfmuxer.cpp (working copy)
+@@ -34,12 +34,12 @@
+ lavfmuxer::lavfmuxer(const char *format, uint32_t audiostreammask, mpgfile &mpg, const char *filename)
+ : muxer(), avfc(0), fileopened(false)
+ {
+- fmt = guess_format(format, NULL, NULL);
++ fmt = av_guess_format(format, NULL, NULL);
+ if (!fmt) {
+ return;
+ }
+
+- avfc=av_alloc_format_context();
++ avfc=avformat_alloc_context();
+ if (!avfc)
+ return;
+
+@@ -73,7 +73,7 @@
+ av_free(s->codec);
+ s->codec = avcodec_alloc_context();
+ avcodec_get_context_defaults(s->codec);
+- s->codec->codec_type=CODEC_TYPE_AUDIO;
++ s->codec->codec_type=AVMEDIA_TYPE_AUDIO;
+ s->codec->codec_id = (mpg.getstreamtype(astr)==streamtype::ac3audio) ?
+ CODEC_ID_AC3 : CODEC_ID_MP2;
+ s->codec->rc_buffer_size = 224*1024*8;
+@@ -92,13 +92,21 @@
+ int16_t samples[AVCODEC_MAX_AUDIO_FRAME_SIZE/sizeof(int16_t)];
+ int frame_size=sizeof(samples);
+ //fprintf(stderr, "** decode audio size=%d\n", sd->inbytes());
+-#if LIBAVCODEC_VERSION_INT >= ((52<<16)+(0<<8)+0)
+- avcodec_decode_audio2
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++ AVPacket avpkt;
++ av_init_packet(&avpkt);
++ avpkt.data = (uint8_t*)sd->getdata();
++ avpkt.size = sd->inbytes();
++ // HACK for CorePNG to decode as normal PNG by default
++ avpkt.flags = AV_PKT_FLAG_KEY;
++ avcodec_decode_audio3(s->codec,samples,&frame_size, &avpkt);
++#elif LIBAVCODEC_VERSION_INT >= ((52<<16)+(0<<8)+0)
++ avcodec_decode_audio2(s->codec,samples,&frame_size,
++ (uint8_t*) sd->getdata(),sd->inbytes());
+ #else
+- avcodec_decode_audio
++ avcodec_decode_audio(s->codec,samples,&frame_size,
++ (uint8_t*) sd->getdata(),sd->inbytes());
+ #endif
+- (s->codec,samples,&frame_size,
+- (uint8_t*) sd->getdata(),sd->inbytes());
+ avcodec_close(s->codec);
+ }
+ break;
diff --git a/dvbcut-fix-help-path.patch b/dvbcut-fix-help-path.patch
new file mode 100644
index 0000000..5fbc9b1
--- /dev/null
+++ b/dvbcut-fix-help-path.patch
@@ -0,0 +1,11 @@
+--- src/dvbcut.cpp.orig 2009-10-26 00:05:33.000000000 +1100
++++ src/dvbcut.cpp 2009-10-26 23:07:56.000000000 +1100
+@@ -2456,7 +2456,7 @@
+ #ifndef __WIN32__
+ // Unix/Linux: search in the associated share subdirectory
+ if (!QFile::exists(helpFile)) {
+- helpFile = appDir.dirPath(true) + "/share/help/dvbcut_en.html";
++ helpFile = appDir.dirPath(true) + "/share/dvbcut/dvbcut_en.html";
+ }
+ #endif
+ if (QFile::exists(helpFile)) {
diff --git a/dvbcut-servicemenu.desktop b/dvbcut-servicemenu.desktop
new file mode 100644
index 0000000..3d49c63
--- /dev/null
+++ b/dvbcut-servicemenu.desktop
@@ -0,0 +1,15 @@
+[Desktop Entry]
+Type=Service
+X-KDE-Priority=TopLevel
+X-KDE-ServiceTypes=KonqPopupMenu/Plugin,video/mpg
+Name=dvbcut mpeg2 tools
+Comment=dvbcut editor menu
+Icon=dvbcut
+Actions=dvbcutOpenMpegStream;
+Name[en_US]=dvbcut-servicemenu
+
+[Desktop Action dvbcutOpenMpegStream]
+Type=Application
+Name=Open mpeg stream in dvbcut
+Exec=dvbcut "%f"
+Icon=dvbcut
diff --git a/dvbcut-snapshot.sh b/dvbcut-snapshot.sh
new file mode 100644
index 0000000..a108197
--- /dev/null
+++ b/dvbcut-snapshot.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+# based on:
+# http://cvs.rpmfusion.org/viewvc/rpms/ffmpeg/F-10/ffmpeg-snapshot.sh?revis...
+# 2009-03-29 DT add request a specific revision, and use the revision number.
+echo " dvbcut-snapshot. A specific svn revision can be passed."
+
+set -e
+
+tmp=$(mktemp -d)
+
+trap cleanup EXIT
+cleanup() {
+ set +e
+ [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
+}
+
+unset CDPATH
+pwd=$(pwd)
+
+if [ -n "$1" ]
+then
+ svnrev=$1
+else
+# determine current head/trunk svn revision number
+ echo " determining the head revision number..."
+ svnrev=$(svn info https://dvbcut.svn.sourceforge.net/svnroot/dvbcut/trunk |grep Revision|cut -c11-)
+fi
+echo " retrieving revision $svnrev ..."
+
+cd "$tmp"
+svn checkout -r $svnrev https://dvbcut.svn.sourceforge.net/svnroot/dvbcut/trunk dvbcut-svn$svnrev
+cd dvbcut-svn$svnrev
+
+echo " stripping ffmpeg and creating bzip2 archive ..."
+# remove included ffmpeg sources
+find . -type d -name "ffmpeg*" -print0 | xargs -0r rm -rf
+
+# remove subversion control files
+find . -type d -name .svn -print0 | xargs -0r rm -rf
+
+# remove debian packaging files
+find . -type d -name "debian*" -print0 | xargs -0r rm -rf
+
+cd ..
+tar jcf "$pwd"/dvbcut-svn$svnrev.tar.bz2 dvbcut-svn$svnrev
+cd - >/dev/null
+
diff --git a/dvbcut-svn176-desktop-additions.patch b/dvbcut-svn176-desktop-additions.patch
new file mode 100644
index 0000000..d09b0c5
--- /dev/null
+++ b/dvbcut-svn176-desktop-additions.patch
@@ -0,0 +1,21 @@
+--- dvbcut.desktop.in.orig 2011-04-25 11:27:29.000000000 +1000
++++ dvbcut.desktop.in 2011-04-26 11:37:42.022156749 +1000
+@@ -2,13 +2,14 @@
+ Type=Application
+ Version=1.0
+ Name=DVBcut
+-GenericName=DVB Cutting Program
++GenericName=DVB Cutting Program for MPEG Transport Stream files
+ NoDisplay=false
+-Comment=Cut DVB streams
++Comment=Trim and cut video MPEG2 transport streams into multiple export formats
+ Icon=@prefix(a)/share/dvbcut/icons/dvbcut.svg
+ TryExec=@prefix@/bin/dvbcut
+ Exec=@prefix@/bin/dvbcut %F
+ Terminal=false
+-MimeType=application/x-dvbcut;
+-Categories=AudioVideo;AudioVideoEditing;Qt;
++MimeType=application/x-dvbcut;video/mpeg;
++Categories=AudioVideo;Player;AudioVideoEditing;Qt;
+ StartupWMClass=Dvbcut
++#nautilus /usr/share/applications, and refresh F5 to see changes to this file.
diff --git a/dvbcut-svn176-fix-help-install-path.patch b/dvbcut-svn176-fix-help-install-path.patch
new file mode 100644
index 0000000..dc91a4e
--- /dev/null
+++ b/dvbcut-svn176-fix-help-install-path.patch
@@ -0,0 +1,11 @@
+--- src/Makefile.in.orig 2011-04-25 11:27:24.000000000 +1000
++++ src/Makefile.in 2011-04-26 10:35:06.439380620 +1000
+@@ -29,7 +29,7 @@
+ datarootdir = @datarootdir@
+ mandir = @mandir@
+ man1dir = $(mandir)/man1
+-helpdir = $(prefix)/share/help
++helpdir = $(datadir)/dvbcut
+
+ installdirs = $(DESTDIR)$(bindir) $(DESTDIR)$(helpdir)
+
diff --git a/dvbcut-svn176-fix-make-install.patch b/dvbcut-svn176-fix-make-install.patch
new file mode 100644
index 0000000..284c786
--- /dev/null
+++ b/dvbcut-svn176-fix-make-install.patch
@@ -0,0 +1,29 @@
+--- makefile.in.orig 2011-04-25 11:27:29.000000000 +1000
++++ makefile.in 2011-04-26 09:56:06.506983163 +1000
+@@ -30,9 +30,9 @@
+ pkgdatadir = $(datarootdir)/dvbcut
+
+ installdirs = $(DESTDIR)$(man1dir) \
+- $(DESTDIR)$(pkgdatadir)/icons \
+- $(DESTDIR)/usr/share/applications \
+- $(DESTDIR)/usr/share/mime/packages
++ $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps \
++ $(DESTDIR)$(datadir)/applications \
++ $(DESTDIR)$(datadir)/mime/packages
+
+ INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+@@ -47,10 +47,9 @@
+ dep-local:
+ install-local: $(installdirs) dvbcut.1 dvbcut.desktop dvbcut.xml
+ $(INSTALL_DATA) dvbcut.1 $(DESTDIR)$(man1dir)/dvbcut.1
+- $(INSTALL_DATA) dvbcut.desktop $(DESTDIR)/usr/share/applications
+- $(INSTALL_DATA) dvbcut.svg $(DESTDIR)$(pkgdatadir)/icons
+- $(INSTALL_DATA) dvbcut.xml $(DESTDIR)/usr/share/mime/packages
+- -update-mime-database $(DESTDIR)/usr/share/mime
++ $(INSTALL_DATA) dvbcut.desktop $(DESTDIR)$(datadir)/applications
++ $(INSTALL_DATA) dvbcut.svg $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps
++ $(INSTALL_DATA) dvbcut.xml $(DESTDIR)$(datadir)/mime/packages
+
+ $(installdirs):
+ $(SHELL) $(top_srcdir)/mkinstalldirs $@
diff --git a/dvbcut-svn179-ffmpeg-0.11.1.patch b/dvbcut-svn179-ffmpeg-0.11.1.patch
new file mode 100644
index 0000000..43c4137
--- /dev/null
+++ b/dvbcut-svn179-ffmpeg-0.11.1.patch
@@ -0,0 +1,88 @@
+diff -ur dvbcut.orig/src/lavfmuxer.cpp dvbcut/src/lavfmuxer.cpp
+--- dvbcut.orig/src/lavfmuxer.cpp 2012-08-31 23:28:42.000000000 +1000
++++ dvbcut/src/lavfmuxer.cpp 2012-09-01 12:12:04.472248687 +1000
+@@ -43,9 +43,16 @@
+ if (!avfc)
+ return;
+
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++// todo: what here ?
++// maybe: AVFormatContext::audio_preload but no direct access.
++// AVOptions
++// iformat
++#else
+ avfc->preload= (int)(.5*AV_TIME_BASE);
+- avfc->max_delay= (int)(.7*AV_TIME_BASE);
+ avfc->mux_rate=10080000;
++#endif
++ avfc->max_delay= (int)(.7*AV_TIME_BASE);
+
+ avfc->oformat=fmt;
+ strncpy(avfc->filename, filename, sizeof(avfc->filename));
+@@ -114,19 +121,36 @@
+ }
+ }
+
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++ // error: 'av_set_parameters' was not declared in this scope
++ if (!(fmt->flags & AVFMT_NOFILE)&&(avio_open(&avfc->pb, filename, AVIO_FLAG_WRITE) < 0)) {
++#else
+ if ((av_set_parameters(avfc, NULL) < 0) || (!(fmt->flags & AVFMT_NOFILE)&&(url_fopen(&avfc->pb, filename, URL_WRONLY) < 0))) {
++#endif
+ av_free(avfc);
+ avfc=0;
+ return;
+ }
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++// todo: what here ?
++// maybe: AVFormatContext::audio_preload but no direct access.
++// AVOptions
++// iformat
++#else
+ avfc->preload= (int)(.5*AV_TIME_BASE);
+- avfc->max_delay= (int)(.7*AV_TIME_BASE);
+ avfc->mux_rate=10080000;
++#endif
++ avfc->max_delay= (int)(.7*AV_TIME_BASE);
+
+-
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++ av_dump_format(avfc, 0, filename, 1);
++ fileopened=true;
++ avformat_write_header(avfc, NULL);
++#else
+ dump_format(avfc, 0, filename, 1);
+ fileopened=true;
+ av_write_header(avfc);
++#endif
+ }
+
+
+@@ -136,7 +160,9 @@
+ if (fileopened) {
+ av_write_trailer(avfc);
+ if (!(fmt->flags & AVFMT_NOFILE))
+-#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(0<<8)+0)
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++ avio_close(avfc->pb);
++#elif LIBAVFORMAT_VERSION_INT >= ((52<<16)+(0<<8)+0)
+ url_fclose(avfc->pb);
+ #else
+ url_fclose(&avfc->pb);
+diff -ur dvbcut.orig/src/mpgfile.cpp dvbcut/src/mpgfile.cpp
+--- dvbcut.orig/src/mpgfile.cpp 2012-09-01 12:26:19.000000000 +1000
++++ dvbcut/src/mpgfile.cpp 2012-09-01 12:49:57.133541130 +1000
+@@ -733,8 +733,11 @@
+ f->pts=idx[idx.indexnr(start+p)].getpts()-startpts;
+ f->coded_picture_number=f->display_picture_number=p;
+ f->key_frame=(p==0)?1:0;
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++ f->pict_type=(p==0)?AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
++#else
+ f->pict_type=(p==0)?FF_I_TYPE:FF_P_TYPE;
+-
++#endif
+ out = avcodec_encode_video(avcc, buf,
+ m2v.getsize(), f);
+
+Only in dvbcut/src: mpgfile.cpp~
diff --git a/dvbcut-svn179-ffmpeg-2.0-compatibility.patch b/dvbcut-svn179-ffmpeg-2.0-compatibility.patch
new file mode 100644
index 0000000..9e8155a
--- /dev/null
+++ b/dvbcut-svn179-ffmpeg-2.0-compatibility.patch
@@ -0,0 +1,101 @@
+--- src/stream.h.orig 2012-08-20 00:00:04.000000000 +1000
++++ src/stream.h 2013-08-22 07:22:41.570965090 +1000
+@@ -52,8 +52,15 @@
+ {
+ if (avcc)
+ av_free(avcc);
+- avcc=avcodec_alloc_context();
+- avcodec_get_context_defaults(avcc);
++ // this guy needs a parameter of..? dec ?
++//AVCodecContext * avcodec_alloc_context3 (const AVCodec *codec)
++// Allocate an AVCodecContext and set its fields to default values.
++ avcc=avcodec_alloc_context3(dec);
++
++//int avcodec_get_context_defaults3 (AVCodecContext *s, const AVCodec *codec)
++// Set the fields of the given AVCodecContext to default values corresponding to the given
++// codec (defaults may be codec-dependent).
++ avcodec_get_context_defaults3(avcc, dec);
+ }
+ void setvideoencodingparameters(bool interlaced=false)
+ {
+
+--- src/lavfmuxer.cpp.orig 2013-08-29 23:08:17.893277000 +1000
++++ src/lavfmuxer.cpp 2013-08-29 23:18:50.872436885 +1000
+@@ -78,8 +78,19 @@
+ strpres[astr]=true;
+ if (s->codec)
+ av_free(s->codec);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++// todo: what here ?
++// maybe need non NULL passed
++// AVCodecContext* avcodec_alloc_context3 ( const AVCodec * codec )
++ s->codec = avcodec_alloc_context3(NULL);
++
++// attribute_deprecated void avcodec_get_context_defaults ( AVCodecContext * s )
++ avcodec_get_context_defaults3(s->codec, NULL);
++
++#else
+ s->codec = avcodec_alloc_context();
+ avcodec_get_context_defaults(s->codec);
++#endif
+ s->codec->codec_type=AVMEDIA_TYPE_AUDIO;
+ s->codec->codec_id = (mpg.getstreamtype(astr)==streamtype::ac3audio) ?
+ CODEC_ID_AC3 : CODEC_ID_MP2;
+@@ -94,11 +105,32 @@
+ break;
+
+ if (sd->getitemlistsize() > 1) {
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++// todo:
++//int avcodec_open2 ( AVCodecContext * avctx,
++// const AVCodec * codec,
++// AVDictionary ** options
++// )
++ if (!avcodec_open2(s->codec,
++ avcodec_find_decoder(s->codec->codec_id), NULL)) {
++#else
+ if (!avcodec_open(s->codec,
+ avcodec_find_decoder(s->codec->codec_id))) {
++#endif
++
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 18, 0)
++// todo:
++// FF_API_OLD_DECODE_AUDIO is not defined, so need to work out how to
++// calc frame_size, or if decode_audio3 needs it
++// used to be AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000
++// trying that
++ int16_t samples[192000/sizeof(int16_t)];
++#else
+ int16_t samples[AVCODEC_MAX_AUDIO_FRAME_SIZE/sizeof(int16_t)];
++#endif
+ int frame_size=sizeof(samples);
+ //fprintf(stderr, "** decode audio size=%d\n", sd->inbytes());
++
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+
+--- src/mpgfile.cpp.orig 2013-08-31 23:32:44.101958000 +1000
++++ src/mpgfile.cpp 2013-08-31 23:45:55.148008273 +1000
+@@ -115,7 +115,7 @@
+ sd->discard(idx[streampic].getpos().packetoffset());
+ }
+
+- if (int rv=avcodec_open(S->avcc, S->dec))
++ if (int rv=avcodec_open2(S->avcc, S->dec, NULL))
+ {
+ fprintf(stderr,"avcodec_open returned %d\n",rv);
+ return;
+
+--- src/mpgfile.cpp.orig 2013-08-30 07:02:11.343953000 +1000
++++ src/mpgfile.cpp 2013-08-31 23:20:40.454837190 +1000
+@@ -709,7 +709,7 @@
+ return;
+ s[VIDEOSTREAM].setvideoencodingparameters();
+
+- if (int rv=avcodec_open(avcc, s[VIDEOSTREAM].enc))
++ if (int rv=avcodec_open2(avcc, s[VIDEOSTREAM].enc, NULL))
+ {
+ if (log)
+ log->printerror("avcodec_open(mpeg2video_encoder) returned %d",rv);
+
diff --git a/dvbcut-svn179-ffmpeg-2.4.3-compatibility.patch b/dvbcut-svn179-ffmpeg-2.4.3-compatibility.patch
new file mode 100644
index 0000000..2f3f8b4
--- /dev/null
+++ b/dvbcut-svn179-ffmpeg-2.4.3-compatibility.patch
@@ -0,0 +1,22 @@
+--- dvbcut-svn179.orig/src/lavfmuxer.cpp 2014-10-20 19:36:01.108711000 +1100
++++ dvbcut-svn179/src/lavfmuxer.cpp 2014-10-20 21:35:28.682373468 +1100
+@@ -60,7 +60,8 @@
+ int id=0;
+
+ st[VIDEOSTREAM].stream_index=id;
+- AVStream *s=st[VIDEOSTREAM].avstr=av_new_stream(avfc,id++);
++ AVStream *s=st[VIDEOSTREAM].avstr=avformat_new_stream(avfc, NULL);
++ s->id = id++;
+ strpres[VIDEOSTREAM]=true;
+ av_free(s->codec);
+ mpg.setvideoencodingparameters();
+@@ -74,7 +75,8 @@
+ if (audiostreammask & (1u<<i)) {
+ int astr=audiostream(i);
+ st[astr].stream_index=id;
+- s=st[astr].avstr=av_new_stream(avfc,id++);
++ s=st[astr].avstr=avformat_new_stream(avfc,NULL);
++ s->id = id++;
+ strpres[astr]=true;
+ if (s->codec)
+ av_free(s->codec);
diff --git a/dvbcut.spec b/dvbcut.spec
new file mode 100644
index 0000000..fba7028
--- /dev/null
+++ b/dvbcut.spec
@@ -0,0 +1,346 @@
+%define svnrev 179
+%if 0%{?fedora} > 6 || 0%{?rhel} > 5
+ %define qt3 qt3
+%else
+ %define qt3 qt
+%endif
+
+Name: dvbcut
+Version: 0.6.1
+Release: 18.svn%{svnrev}%{?dist}
+Summary: Clip and convert DVB transport streams to MPEG2 program streams
+
+Group: Applications/Multimedia
+License: GPLv2+ and LGPLv2
+URL: http://dvbcut.sourceforge.net/
+# fixes were committed to svn since release, so using svn checkout for latest fixes:
+# original upstream archive location:
+#Source0: http://downloads.sourceforge.net/dvbcut/dvbcut_% {version}.tar.bz2
+# current upstream release location:
+#Source0: http://www.mr511.de/dvbcut/dvbcut-0.6.1.tar.gz
+# use sh dvbcut-snapshot.sh to create the archive
+Source0: %{name}-svn%{svnrev}.tar.bz2
+# This desktop file was created by hand.
+Source5: %{name}-snapshot.sh
+Source6: %{name}-servicemenu.desktop
+# helpfile is placed in /usr/share/help. Look for it under /usr/share/dvbcut instead
+Patch0: %{name}-fix-help-path.patch
+Patch1: %{name}-svn176-fix-make-install.patch
+Patch2: %{name}-svn176-fix-help-install-path.patch
+Patch3: %{name}-svn176-desktop-additions.patch
+Patch6: %{name}-179-vs-ubuntu-12.04.diff
+Patch7: %{name}-svn179-ffmpeg-0.11.1.patch
+Patch8: %{name}-svn179-ffmpeg-2.0-compatibility.patch
+Patch9: %{name}-svn179-ffmpeg-2.4.3-compatibility.patch
+
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+BuildRequires: autoconf
+BuildRequires: %{qt3}-devel
+BuildRequires: libao-devel
+BuildRequires: a52dec-devel
+BuildRequires: libmad-devel
+BuildRequires: ffmpeg-devel
+BuildRequires: desktop-file-utils
+BuildRequires: kde-filesystem
+Requires: hicolor-icon-theme
+# mplayer not actually required, but much better with it.
+Requires: mplayer
+Requires: kde-filesystem
+
+%description
+dvbcut is a Qt application that allows you to select certain parts of an MPEG
+transport stream (as received via Digital Video Broadcasting, DVB) and save
+these parts into a single MPEG output file. It follows a "keyhole surgery"
+approach where the input video and audio data is mostly kept unchanged, and
+only very few frames at the beginning and/or end of the selected range are
+re-encoded in order to obtain a valid MPEG file. For MPEG video playback
+dvbcut can use Mplayer if available.
+
+
+%prep
+# for release archive
+#%#setup -q
+# for svn tag
+%setup -q -n %{name}-svn%{svnrev}
+%patch0 -b .fix-help-path
+%patch1 -b .fix-make-install
+%patch2 -b .fix-help-install
+%patch3 -b .desktop-improvements
+%patch6 -b .ubuntu
+%patch7 -p1 -b .ffmpeg-0.11.1
+%patch8 -b .ffmpeg-2.0
+%patch9 -p1 -b .ffmpeg-2.4.3
+
+# Fix QTDIR libs in configure
+sed -i 's,$QTDIR/$mr_libdirname,$QTDIR/lib,' configure.in
+
+# Avoid stripping binaries
+sed -i 's,$(STRIP) $(topdir)/bin/dvbcut$(EXEEXT),,' src/Makefile.in
+
+# don't try to make Debian and ffmpeg files that have been stripped
+sed -i '/debian/d' DISTFILES
+sed -i '/ffmpeg.src/d' DISTFILES
+
+
+%build
+unset QTDIR || : ; . /etc/profile.d/qt.sh
+autoconf
+%configure --with-ffmpeg=%{_prefix} \
+ --with-ffmpeg-include=%{_includedir}/ffmpeg
+ helpdir=%{_datadir}/%{name}
+
+# It does not compile with smp_mflags
+make
+
+
+%install
+make DESTDIR=%{buildroot} install
+
+mkdir -p %{buildroot}%{_datadir}/applications
+desktop-file-install --vendor="" \
+ --dir %{buildroot}%{_datadir}/applications dvbcut.desktop
+
+mkdir -p %{buildroot}%{_kde4_datadir}/kde4/services/
+cp %{SOURCE6} %{buildroot}%{_kde4_datadir}/kde4/services/
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%post
+touch --no-create %{_datadir}/icons/hicolor || :
+if [ -x %{_bindir}/gtk-update-icon-cache ]; then
+ %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
+fi
+
+update-desktop-database &> /dev/null || :
+
+
+%postun
+touch --no-create %{_datadir}/icons/hicolor || :
+if [ -x %{_bindir}/gtk-update-icon-cache ]; then
+ %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
+fi
+
+update-desktop-database &> /dev/null || :
+
+
+%files
+%defattr(-,root,root,-)
+%doc ChangeLog COPYING CREDITS README README.icons
+%{_bindir}/%{name}
+%{_mandir}/man1/%{name}.1.gz
+%{_datadir}/applications/*.desktop
+%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
+%{_datadir}/%{name}/dvbcut_*.html
+%{_kde4_datadir}/kde4/services/*.desktop
+%{_datadir}/mime/packages/dvbcut.xml
+
+
+%changelog
+* Mon Oct 20 2014 David Timms <iinet.net.au at dtimms> - 0.6.1-18.svn179
+- add patch for ffmpeg-2.4.3 for dropped av_new_stream().
+
+* Fri Sep 26 2014 Nicolas Chauvet <kwizart(a)gmail.com> - 0.6.1-17.svn179
+- Rebuilt for FFmpeg 2.4.x
+
+* Thu Aug 07 2014 Sérgio Basto <sergio(a)serjux.com> - 0.6.1-16.svn179
+- Rebuilt for ffmpeg-2.3
+
+* Sat Mar 29 2014 Sérgio Basto <sergio(a)serjux.com> - 0.6.1-15.svn179
+- Rebuilt for ffmpeg-2.2
+
+* Mon Sep 30 2013 Nicolas Chauvet <kwizart(a)gmail.com> - 0.6.1-14.svn179
+- Rebuilt
+
+* Wed Sep 04 2013 David Timms <iinet.net.au at dtimms>- 0.6.1-13.svn179
+- add patch to use new ffmpeg-2.0 rather than deprecated functions
+
+* Thu Aug 15 2013 Nicolas Chauvet <kwizart(a)gmail.com> - 0.6.1-12.svn179
+- Rebuilt for FFmpeg 2.0.x
+
+* Sun May 26 2013 Nicolas Chauvet <kwizart(a)gmail.com> - 0.6.1-11.svn179
+- Rebuilt for x264/FFmpeg
+
+* Sun May 19 2013 David Timms <iinet.net.au at dtimms> - 0.6.1-10.svn179
+- fix changelog dates to match day as detected by mock-1.1.32-1.fc18.noarch
+- fix bonus / in ffmpeg include path triggering build failure extracting debug
+ info debugedit: canonicalization unexpectedly shrank by one character
+
+* Sun Apr 28 2013 Nicolas Chauvet <kwizart(a)gmail.com> - 0.6.1-9.svn179
+- https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Sat Nov 24 2012 Nicolas Chauvet <kwizart(a)gmail.com> - 0.6.1-8.svn179
+- Rebuilt for FFmpeg 1.0
+
+* Wed Aug 29 2012 David Timms <iinet.net.au at dtimms> - 0.6.1-7.svn179
+- drop upstreamed gcc47 patch
+- add ffmpeg-0.10.4 patch dvbcut-179-vs-ubuntu-12.04.diff from Olaf Dietsche
+- drop ffmpeg-0.8.2 patch superseded by ffmpeg-0.10.4 patch
+- add ffmpeg-0.11.1 patch
+- modify kde service install from desktop-file-install to copy.
+
+* Tue Jun 26 2012 Nicolas Chauvet <kwizart(a)gmail.com> - 0.6.1-6.svn178
+- Rebuilt for FFmpeg
+
+* Wed May 23 2012 Nicolas Chauvet <kwizart(a)gmail.com> - 0.6.1-5.svn178
+- Fix FTBFS with gcc47
+
+* Tue Feb 28 2012 Nicolas Chauvet <kwizart(a)gmail.com> - 0.6.1-4.svn178
+- Rebuilt for x264/FFmpeg
+
+* Wed Feb 08 2012 Nicolas Chauvet <kwizart(a)gmail.com> - 0.6.1-3.svn178
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Mon Sep 5 2011 David Timms <iinet.net.au at dtimms> - 0.6.1-2.svn178
+- update to 0.6.1 release post svn178
+- add patch for ffmpeg-0.8.2
+
+* Mon Apr 25 2011 David Timms <iinet.net.au at dtimms> - 0.6.1-1.svn176
+- update to 0.6.1 release post svn176
+- includes upstream enhancement to work with certain transport streams
+- delete upstreamed patches
+- update makefile patches
+- delete desktop file, patch included desktop file instead.
+
+* Fri Apr 22 2011 David Timms <iinet.net.au at dtimms> - 0.6.0-13.svn170
+- add patch to fix code to allow build with gcc-4.6
+- add export dialog close button to suit gnome 3
+
+* Thu Mar 17 2011 David Timms <iinet.net.au at dtimms> - 0.6.0-12.svn170
+- fix Makefile.in to place files into standard locations
+- fix src/Makefile to place online help in standard location
+- del old icons
+- package new icon and mime info files
+- adjust configure/make/install to suit fixed Makefile.in
+
+* Fri Feb 11 2011 David Timms <iinet.net.au at dtimms> - 0.6.0-11.svn170
+- update to svn170 to pull in gcc-4.5 patches
+
+* Mon Oct 26 2009 David Timms <iinet.net.au at dtimms> - 0.6.0-10.svn166
+- update to svn166
+- drop upstreamed gcc44 patch
+- add mpg mimetype to gnome desktop to provide mpeg open with in nautilus
+- add kde service menu for mpg files for dolphin
+- add help menu to package
+- fix help file being placed in /usr/share/help
+
+* Fri Oct 23 2009 Orcan Ogetbil <oged[DOT]fedora[AT]gmail[DOT]com> - 0.6.0-9.svn157
+- Update desktop file according to F-12 FedoraStudio feature
+
+* Wed Oct 21 2009 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.6.0-8.svn157
+- rebuilt
+
+* Mon Apr 6 2009 David Timms <iinet.net.au at dtimms> - 0.6.0-7.svn157
+- mod QTDIR configure.in patch to match newer configure.in revision
+
+* Sat Apr 4 2009 David Timms <iinet.net.au at dtimms> - 0.6.0-6.svn157
+- use distro conditional to determine name of BR qt3-devel
+
+* Fri Apr 3 2009 David Timms <iinet.net.au at dtimms> - 0.6.0-5.svn157
+- use another BR qt3 variant to work on both fedora and epel
+
+* Thu Apr 2 2009 David Timms <iinet.net.au at dtimms> - 0.6.0-4.svn157
+- adjust BR for qt3 to work on both fedora and epel
+
+* Sun Mar 29 2009 David Timms <iinet.net.au at dtimms> - 0.6.0-3.svn157
+- add gcc4 patch for rawhide
+
+* Sun Mar 29 2009 David Timms <iinet.net.au at dtimms> - 0.6.0-2.svn157
+- update to latest post release svn checkout for minor fixes
+- improve dvbcut-snapshot script to not use the checkout date
+- del the debian packaging files from the snapshot archive
+- mod spec to use svnver rather svndate, to make it easier to confirm sources
+- del lines from DISTFILES that reference removed files
+
+* Sat Feb 7 2009 David Timms <iinet.net.au at dtimms> - 0.6.0-1.20090207svn156
+- update to 0.6.0 release, still using post release svn checkout
+
+* Thu Jan 1 2009 David Timms <iinet.net.au at dtimms> - 0.5.4-6.20090101svn138
+- add required alphatag to post release package name
+- mod License to be GPLv2+ and LGPLv2
+- mod -snapshot script to nuke internal ffmpeg source
+- mod files to use the defined name macro
+- include .tar.bz2 created with modified snapshot script. Still svn138
+
+* Wed Dec 31 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-5.20081218
+- cosmetic change, and rebuild Andrea's changes for review
+
+* Mon Dec 29 2008 Andrea Musuruane <musuruan(a)gmail.com> - 0.5.4-4.20081218
+- removed ugly configure hack in %%install
+- removed %%{?_smp_mflags} from make invocation
+- patched configure to fix qt lib dir
+- cosmetic changes
+
+* Wed Dec 24 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-3.20081218
+- fix x86_64 configure by supplying qt lib dir
+
+* Tue Dec 23 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-2.20081218
+- add BR: autoconf to solve mock build issue
+- del repeated parameters from build due to change to configure macro
+
+* Mon Dec 22 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-1.20081218
+- use correct post release versioning scheme
+- remove --vendor from desktop-file-install
+- remove .desktop en-au identical translation
+- use configure macro instead of ./configure in build and install
+
+* Sun Dec 21 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.13.20081218
+- remove execute permission from dvbcut-snapshot.sh
+- add re-configure in %%install to move installdir reference from %%build
+
+* Sun Dec 21 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.12.20081218
+- fix generation of debuginfo
+- test rebuild against ffmpeg-libs-0.4.9-0.57.20081217.fc11
+
+* Sat Dec 20 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.11.20081218
+- change to autotools build system
+- fix icon source file install
+- drop ffmpeg path patches; autotools solves this ;)
+
+* Sat Dec 20 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.10.20081218
+- mod icon install to work in a loop
+- del some old comments
+
+* Thu Dec 18 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.9.20081218
+- update to current svn revision 138
+- add Requires: hicolor-icon-theme to provide correct icon dir ownership
+- del DesktopFileVersion: field from .desktop file
+- del .desktop icon filename size indicator, so that system can choose
+- mod icon install to use a common png filename below icons/size/apps/
+- add shell script to archive a dated svn revision
+- add patches for ffmpeg's change in include folder layout
+
+* Wed Jun 25 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.8.20080621svn131
+- add conditional build requires to ensure it builds against correct qt[3]-devel
+
+* Sat Jun 21 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.7.20080621svn131
+- previous build crashes if the export via ffmpeg functions are used
+- update to current svn revision
+
+* Sun Jun 15 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.6.20080621svn129
+- update to current svn revision
+- upstream added make/autoconf via configure/make to the source, but we are are
+ able to fallback to SCons build - which succeeded.
+
+* Sat Jun 07 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.5.20080607svn125.fc9
+- update to current svn revision, unsuccessful compile. SCons issues.
+
+* Sat Mar 15 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.4.20080314svn118.fc9
+- add BuildRequires desktop-file-utils so that it builds properly in mock.
+- update to new upstream svn version.
+- drop patch0-4 since similar have been committed upstream.
+
+* Sat Mar 1 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.3.20080217svn116.fc9
+- patch SContruct to generate decent debuginfo.
+- fix install to use make install. Fixes docs install problem.
+- add man to files.
+- del BuildRequires gettext desktop-file-utils since they aren't required.
+- del Requires qt ffmpeg since rpm should take care of that.
+
+* Fri Feb 29 2008 David Timms <iinet.net.au at dtimms> - 0.5.4-0.2.20080217svn116.fc9
+- mod spec to suit svn release. include patches, icons, desktop file.
+
+* Thu Nov 08 2007 David Timms <iinet.net.au at dtimms> - 0.5.4-0.1
+- initial package for fedora (based on Herbert Graeber packman effort)
diff --git a/sources b/sources
new file mode 100644
index 0000000..947f4bb
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+467975975bc7bf6abcb559449e776654 dvbcut-svn179.tar.bz2
8 years
[dvbcut/f25] rebuild for ffmpeg-3.0.3
by David Timms
commit 9064cb53c9d68d3661c657c63f817f1112a46673
Author: David Timms <dtimms(a)iinet.net.au>
Date: Mon Nov 7 23:00:42 2016 +1100
rebuild for ffmpeg-3.0.3
- add combined patch covering:
- ffmpeg-3.0.3 for removed deprecated definitions and functions.
- signed-unsigned comparison warnings.
- whitespace alignment warnings.
- replace tabs with spaces to match existing source files.
- c++ compiler c11 fixes (not compatble with <=F23).
- unused variables.
dvbcut-svn179-ffmpeg-3.0.3-compatibility.patch | 1100 ++++++++++++++++++++++++
dvbcut.spec | 14 +-
2 files changed, 1113 insertions(+), 1 deletion(-)
---
diff --git a/dvbcut-svn179-ffmpeg-3.0.3-compatibility.patch b/dvbcut-svn179-ffmpeg-3.0.3-compatibility.patch
new file mode 100644
index 0000000..2f1e756
--- /dev/null
+++ b/dvbcut-svn179-ffmpeg-3.0.3-compatibility.patch
@@ -0,0 +1,1100 @@
+diff -ur dvbcut-svn179.orig/src/avframe.cpp dvbcut-svn179/src/avframe.cpp
+--- dvbcut-svn179.orig/src/avframe.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/avframe.cpp 2016-11-05 18:14:00.482888961 +1100
+@@ -23,26 +23,52 @@
+ #include <cstdio>
+ #include "avframe.h"
+
++#define IMAGE_ALIGN_VALUE 1 // no idea what an ideal value is.
++
+ #ifdef HAVE_LIB_SWSCALE
+ avframe::avframe() : tobefreed(0),w(0),h(0),dw(0),pix_fmt(),img_convert_ctx(0)
+ #else
+ avframe::avframe() : tobefreed(0),w(0),h(0),dw(0),pix_fmt()
+ #endif
+ {
+- f=avcodec_alloc_frame();
++ f=av_frame_alloc();
+ }
+
+ avframe::avframe(AVFrame *src, AVCodecContext *ctx) : f(0),tobefreed(0)
+ {
+- f=avcodec_alloc_frame();
+- tobefreed=malloc(avpicture_get_size(ctx->pix_fmt, ctx->width, ctx->height));
+-
+- avpicture_fill((AVPicture *)f,
++ f=av_frame_alloc();
++/*
++int avpicture_get_size (enum AVPixelFormat pix_fmt, int width, int height)
++Deprecated:
++ use av_image_get_buffer_size() instead:
++int av_image_get_buffer_size (enum AVPixelFormat pix_fmt, int width, int height, int align)
++https://www.ffmpeg.org/doxygen/3.0/group__lavu__picture.html#ga24a67963c3ae0054a2a4bab35930e694
++
++*/
++ tobefreed=malloc(av_image_get_buffer_size(ctx->pix_fmt, ctx->width, ctx->height, IMAGE_ALIGN_VALUE));
++
++/*
++int avpicture_fill (AVPicture * picture, const uint8_t * ptr
++ , enum AVPixelFormat pix_fmt, int width, int height)
++Deprecated:
++ use av_image_fill_arrays() instead:
++int av_image_fill_arrays(uint8_t * dst_data[4], int dst_linesize[4], const uint8_t * src
++ , enum AVPixelFormat pix_fmt, int width, int height, int align)
++*/
++ av_image_fill_arrays(f->data, f->linesize,
+ (u_int8_t*)tobefreed,
+- ctx->pix_fmt,ctx->width,ctx->height);
++ ctx->pix_fmt, ctx->width, ctx->height, IMAGE_ALIGN_VALUE);
+
+-#if LIBAVCODEC_VERSION_INT >= (51 << 16)
+- av_picture_copy((AVPicture *)f, (const AVPicture *) src,
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(51, 0, 0)
++/*
++void av_picture_copy(AVPicture * dst, const AVPicture * src
++ , enum AVPixelFormat pix_fmt, int width, int height)
++Deprecated: av_image_copy() instead:
++void av_image_copy (uint8_t * dst_data[4], int dst_linesizes[4]
++ , const uint8_t * src_data[4], const int src_linesizes[4]
++ , enum AVPixelFormat pix_fmt, int width, int height)
++*/
++ av_image_copy(f->data, f->linesize, (const uint8_t **)src->data, src->linesize,
+ ctx->pix_fmt, ctx->width, ctx->height);
+ #else
+ img_copy((AVPicture *)f, (const AVPicture *) src,
+@@ -65,7 +91,7 @@
+ dw=w*ctx->sample_aspect_ratio.num/ctx->sample_aspect_ratio.den;
+ #ifdef HAVE_LIB_SWSCALE
+ img_convert_ctx=sws_getContext(w, h, pix_fmt,
+- w, h, PIX_FMT_BGR24, SWS_BICUBIC,
++ w, h, AV_PIX_FMT_BGR24, SWS_BICUBIC,
+ NULL, NULL, NULL);
+ #endif
+ }
+@@ -91,20 +117,20 @@
+ #endif
+ return QImage();
+
+- uint8_t *rgbbuffer=(uint8_t*)malloc(avpicture_get_size(PIX_FMT_RGB24, w, h)+64);
++ uint8_t *rgbbuffer=(uint8_t*)malloc(av_image_get_buffer_size(AV_PIX_FMT_RGB24, w, h, IMAGE_ALIGN_VALUE)+64);
+ int headerlen=sprintf((char *) rgbbuffer, "P6\n%d %d\n255\n", w, h);
+
+- AVFrame *avframergb=avcodec_alloc_frame();
++ AVFrame *avframergb=av_frame_alloc();
+
+- avpicture_fill((AVPicture*)avframergb,
++ av_image_fill_arrays(avframergb->data, avframergb->linesize,
+ rgbbuffer+headerlen,
+- PIX_FMT_RGB24,w,h);
++ AV_PIX_FMT_RGB24, w, h, IMAGE_ALIGN_VALUE);
+
+ #ifdef HAVE_LIB_SWSCALE
+ sws_scale(img_convert_ctx, f->data, f->linesize, 0, h,
+ avframergb->data, avframergb->linesize);
+ #else
+- img_convert((AVPicture *)avframergb, PIX_FMT_RGB24, (AVPicture*)f, pix_fmt, w, h);
++ img_convert((AVPicture *)avframergb, AV_PIX_FMT_RGB24, (AVPicture*)f, pix_fmt, w, h);
+ #endif
+
+ QImage im;
+diff -ur dvbcut-svn179.orig/src/avframe.h dvbcut-svn179/src/avframe.h
+--- dvbcut-svn179.orig/src/avframe.h 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/avframe.h 2016-11-05 18:14:00.480888996 +1100
+@@ -23,6 +23,7 @@
+
+ extern "C" {
+ #include <avcodec.h>
++#include <libavutil/imgutils.h>
+ #ifdef HAVE_LIB_SWSCALE
+ #include <swscale.h>
+ #endif
+@@ -39,7 +40,7 @@
+ AVFrame *f;
+ void *tobefreed;
+ int w,h,dw;
+- enum PixelFormat pix_fmt;
++ enum AVPixelFormat pix_fmt;
+ #ifdef HAVE_LIB_SWSCALE
+ struct SwsContext *img_convert_ctx;
+ #endif
+@@ -69,7 +70,7 @@
+ {
+ return dw;
+ }
+- enum PixelFormat getpixfmt() const
++ enum AVPixelFormat getpixfmt() const
+ {
+ return pix_fmt;
+ }
+diff -ur dvbcut-svn179.orig/src/buffer.cpp dvbcut-svn179/src/buffer.cpp
+--- dvbcut-svn179.orig/src/buffer.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/buffer.cpp 2016-11-05 18:14:00.483888944 +1100
+@@ -386,7 +386,10 @@
+ }
+ #endif
+ size_t len = mmapsize;
+- if (newpos + len > i->end)
++// dvbcut_off_t + size_t > std::vector<infile>::const_iterator
++// (aka 'long') + (unsigned int) > (unsigned int)
++// if ((newpos > 0) && (static_cast<int>(newpos) + len > i->end))
++ if ((newpos > 0) && (static_cast<unsigned int>(newpos + len) > i->end))
+ len = i->end - newpos;
+ void *ptr = ::mmap(0, len, PROT_READ, MAP_SHARED, i->fd, relpos);
+ if (ptr != MAP_FAILED) {
+@@ -452,7 +455,9 @@
+ needseek = false;
+ }
+ size_t len = size - writepos;
+- if (len > i->end - seekpos)
++// size_t > unsigned int - dvbcut_off_t
++// unsigned int > unsigned int - aka long
++ if ((seekpos > 0) && (len > static_cast<unsigned int>(i->end - seekpos)))
+ len = i->end - seekpos;
+ assert(len > 0);
+ ssize_t n = ::read(i->fd, (char*)d + writepos, len);
+diff -ur dvbcut-svn179.orig/src/dvbcut.cpp dvbcut-svn179/src/dvbcut.cpp
+--- dvbcut-svn179.orig/src/dvbcut.cpp 2016-11-05 19:09:50.368119901 +1100
++++ dvbcut-svn179/src/dvbcut.cpp 2016-11-05 18:14:00.490888821 +1100
+@@ -282,15 +282,15 @@
+ EventListItem::eventtype evt=eli->geteventtype();
+
+ if (evt==EventListItem::start)
+- elemname="start";
++ elemname="start";
+ else if (evt==EventListItem::stop)
+- elemname="stop";
++ elemname="stop";
+ else if (evt==EventListItem::chapter)
+- elemname="chapter";
++ elemname="chapter";
+ else if (evt==EventListItem::bookmark)
+- elemname="bookmark";
++ elemname="bookmark";
+ else
+- continue;
++ continue;
+
+ QDomElement elem=doc.createElement(elemname);
+ elem.setAttribute("picture",eli->getpicture());
+@@ -429,7 +429,8 @@
+ samples = samples>0 ? samples: 1;
+ samples = samples>abs(range) ? abs(range)+1: samples;
+
+- int bestpic = startpic+range, bestnr=0;
++ int bestpic = startpic+range;
++ //, bestnr=0;
+ double bestval = 0.;
+ int dp = range/(samples-1);
+ int ncol = nr*ng*nb;
+@@ -487,7 +488,7 @@
+ if(entropy>bestval) {
+ bestval=entropy;
+ bestpic=pic;
+- bestnr=n;
++// bestnr=n;
+ }
+ }
+ //fprintf(stderr,"choosing sample / frame: %4d / %7d\n!", bestnr, bestpic);
+@@ -517,7 +518,7 @@
+ }
+ }
+
+- std::auto_ptr<exportdialog> expd(new exportdialog(expfilen,this));
++ std::unique_ptr<exportdialog> expd(new exportdialog(expfilen,this));
+ expd->muxercombo->insertItem("MPEG program stream/DVD (DVBCUT multiplexer)");
+ expd->muxercombo->insertItem("MPEG program stream (DVBCUT multiplexer)");
+ expd->muxercombo->insertItem("MPEG program stream/DVD (libavformat)");
+@@ -575,7 +576,7 @@
+ int(lastch/(3600*90000)),
+ int(lastch/(60*90000))%60,
+ int(lastch/90000)%60,
+- int(lastch/90)%1000 );
++ int(lastch/90)%1000);
+ // append chapter marks to lists for plain text / dvdauthor xml-file
+ chapterstring+=chapter;
+ chaptercolumn+=chapter;
+@@ -625,12 +626,12 @@
+ if (child_pid == 0) {
+ ::close(pipe_fds[1]);
+ if (pipe_fds[0] != STDIN_FILENO) {
+- dup2(pipe_fds[0], STDIN_FILENO);
++ dup2(pipe_fds[0], STDIN_FILENO);
+ }
+ //fprintf(stderr, "Executing %s\n", expcmd.c_str()+pos);
+ for (int fd=0; fd<256; ++fd)
+- if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO)
+- ::close(fd);
++ if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO)
++ ::close(fd);
+ execl("/bin/sh", "sh", "-c", expcmd.c_str()+pos, (char *)0);
+ _exit(127);
+ }
+@@ -661,7 +662,7 @@
+
+ // lavfmuxer mux(fmt,*mpg,outfilename);
+
+- std::auto_ptr<muxer> mux;
++ std::unique_ptr<muxer> mux;
+ uint32_t audiostreammask(0);
+
+ for(int a=0;a<mpg->getaudiostreams();++a)
+@@ -673,17 +674,17 @@
+
+ switch(expfmt) {
+ case 1:
+- mux=std::auto_ptr<muxer>(new mpegmuxer(audiostreammask,*mpg,out_file.c_str(),false,0));
++ mux=std::unique_ptr<muxer>(new mpegmuxer(audiostreammask,*mpg,out_file.c_str(),false,0));
+ break;
+ case 2:
+- mux=std::auto_ptr<muxer>(new lavfmuxer("dvd",audiostreammask,*mpg,out_file.c_str()));
++ mux=std::unique_ptr<muxer>(new lavfmuxer("dvd",audiostreammask,*mpg,out_file.c_str()));
+ break;
+ case 3:
+- mux=std::auto_ptr<muxer>(new lavfmuxer("mpegts",audiostreammask,*mpg,out_file.c_str()));
++ mux=std::unique_ptr<muxer>(new lavfmuxer("mpegts",audiostreammask,*mpg,out_file.c_str()));
+ break;
+ case 0:
+ default:
+- mux=std::auto_ptr<muxer>(new mpegmuxer(audiostreammask,*mpg,out_file.c_str()));
++ mux=std::unique_ptr<muxer>(new mpegmuxer(audiostreammask,*mpg,out_file.c_str()));
+ break;
+ }
+
+@@ -718,7 +719,7 @@
+ stoppts=quick_picture_lookup[num].stoppts;
+
+ log->printheading("%d. Exporting %d pictures: %s .. %s",
+- num+1,stoppic-startpic,ptsstring(startpts).c_str(),ptsstring(stoppts).c_str());
++ num+1,stoppic-startpic,ptsstring(startpts).c_str(),ptsstring(stoppts).c_str());
+ mpg->savempg(*mux,startpic,stoppic,savedpic,quick_picture_lookup.back().outpicture,log);
+
+ savedpic=quick_picture_lookup[num].outpicture;
+@@ -728,10 +729,10 @@
+ mux.reset();
+
+ log->printheading("Saved %d pictures (%02d:%02d:%02d.%03d)",savedpic,
+- int(savedtime/(3600*90000)),
+- int(savedtime/(60*90000))%60,
+- int(savedtime/90000)%60,
+- int(savedtime/90)%1000 );
++ int(savedtime/(3600*90000)),
++ int(savedtime/(60*90000))%60,
++ int(savedtime/90000)%60,
++ int(savedtime/90)%1000);
+
+ #ifndef __WIN32__
+ if (child_pid > 0) {
+@@ -1152,7 +1153,7 @@
+ dvbcut_off_t partoffset;
+ int partindex = buf.getfilenum(offset, partoffset);
+ if (partindex == -1)
+- return; // what else can we do?
++ return; // what else can we do?
+
+ mplayer_process=new QProcess(QString("mplayer"));
+ mplayer_process->addArgument("-noconsolecontrols");
+@@ -1298,13 +1299,13 @@
+ fine=false;
+ } else if (relpic<=-settings().jog_threshold) {
+ fine=false;
+- } else
++ } else {
+ fine=true;
++ }
++ if (curpic!=newpic)
++ linslider->setValue(newpic);
+
+- if (curpic!=newpic)
+- linslider->setValue(newpic);
+-
+- fine=false;
++ fine=false;
+ }
+
+
+@@ -1743,81 +1744,89 @@
+ line=line.stripWhiteSpace();
+ }
+ if (line.startsWith(QString("<!DOCTYPE"))
+- || line.startsWith(QString("<?xml"))) {
++ || line.startsWith(QString("<?xml"))) {
+ infile.at(0);
+ QString errormsg;
+ if (domdoc.setContent(&infile,false,&errormsg)) {
+ QDomElement docelem = domdoc.documentElement();
+ if (docelem.tagName() != "dvbcut") {
+ critical("Failed to read project file - dvbcut",
+- QString(filename) + ":\nNot a valid dvbcut project file");
++ QString(filename) + ":\nNot a valid dvbcut project file");
+ fileOpenAction->setEnabled(true);
+ return;
+ }
+- // parse elements, new-style first
+- QDomNode n;
+- filenames.clear();
+- if (!nogui) {
+- // in batch mode CLI-switches have priority!
+- idxfilename.clear();
+- expfilename.clear();
+- }
+- for (n = domdoc.documentElement().firstChild(); !n.isNull(); n = n.nextSibling()) {
+- QDomElement e = n.toElement();
+- if (e.isNull())
+- continue;
+- if (e.tagName() == "mpgfile") {
+- QString qs = e.attribute("path");
+- if (!qs.isEmpty())
+- filenames.push_back((const char*)qs);
+- }
+- else if (e.tagName() == "idxfile" && idxfilename.empty()) {
+- QString qs = e.attribute("path");
+- if (!qs.isEmpty())
+- idxfilename = (const char*)qs;
+- }
+- else if (e.tagName() == "expfile" && expfilename.empty()) {
+- QString qs = e.attribute("path");
+- if (!qs.isEmpty())
+- expfilename = (const char*)qs;
+- qs = e.attribute("format");
++ // parse elements, new-style first
++ QDomNode n;
++ filenames.clear();
++ if (!nogui) {
++ // in batch mode CLI-switches have priority!
++ idxfilename.clear();
++ expfilename.clear();
++ }
++ for (n = domdoc.documentElement().firstChild(); !n.isNull(); n = n.nextSibling()) {
++ QDomElement e = n.toElement();
++ if (e.isNull())
++ continue;
++ if (e.tagName() == "mpgfile") {
++ QString qs = e.attribute("path");
++ if (!qs.isEmpty()) {
++ filenames.push_back((const char*)qs);
++ }
++ }
++ else if (e.tagName() == "idxfile" && idxfilename.empty()) {
++ QString qs = e.attribute("path");
++ if (!qs.isEmpty())
++ {
++ idxfilename = (const char*)qs;
++ }
++ }
++ else if (e.tagName() == "expfile" && expfilename.empty()) {
++ QString qs = e.attribute("path");
++ if (!qs.isEmpty()) {
++ expfilename = (const char*)qs;
++ }
++ qs = e.attribute("format");
+ bool okay=false;
+- if (!qs.isEmpty()) {
++ if (!qs.isEmpty()) {
+ int val = qs.toInt(&okay,0);
+- if(okay) exportformat = val;
++ if(okay) {
++ exportformat = val;
++ }
+ }
+- }
+- }
+- // try old-style project file format
+- if (filenames.empty()) {
+- QString qs = docelem.attribute("mpgfile");
+- if (!qs.isEmpty())
+- filenames.push_back((const char*)qs);
+- }
+- if (idxfilename.empty()) {
+- QString qs = docelem.attribute("idxfile");
+- if (!qs.isEmpty())
+- idxfilename = (const char*)qs;
+- }
+- if (expfilename.empty()) {
+- QString qs = docelem.attribute("expfile");
+- if (!qs.isEmpty())
+- expfilename = (const char*)qs;
+- }
+- // sanity check
+- if (filenames.empty()) {
+- critical("Failed to read project file - dvbcut",
+- QString(filename) + ":\nNo MPEG filename given in project file");
+- fileOpenAction->setEnabled(true);
+- return;
+- }
+- prjfilename = filename;
+- }
+- else {
+- critical("Failed to read project file - dvbcut",
+- QString(filename) + ":\n" + errormsg);
+- fileOpenAction->setEnabled(true);
+- return;
++ }
++ }
++ // try old-style project file format
++ if (filenames.empty()) {
++ QString qs = docelem.attribute("mpgfile");
++ if (!qs.isEmpty()) {
++ filenames.push_back((const char*)qs);
++ }
++ }
++ if (idxfilename.empty()) {
++ QString qs = docelem.attribute("idxfile");
++ if (!qs.isEmpty()) {
++ idxfilename = (const char*)qs;
++ }
++ if (expfilename.empty()) {
++ QString qs = docelem.attribute("expfile");
++ if (!qs.isEmpty())
++ expfilename = (const char*)qs;
++ }
++ // sanity check
++ if (filenames.empty()) {
++ critical("Failed to read project file - dvbcut",
++ QString(filename) + ":\nNo MPEG filename given in project file");
++ fileOpenAction->setEnabled(true);
++ return;
++ }
++ prjfilename = filename;
++ }
++ else {
++ critical("Failed to read project file - dvbcut",
++ QString(filename) + ":\n" + errormsg);
++ fileOpenAction->setEnabled(true);
++ return;
++ }
+ }
+ }
+ }
+@@ -1849,34 +1858,38 @@
+ if (idxfilename.empty()) {
+ idxfilename = filename + ".idx";
+ if (!nogui) {
+- /*
+- * BEWARE! UGLY HACK BELOW!
+- *
+- * In order to circumvent the QFileDialog's stupid URL parsing,
+- * we need to first change to the directory and then pass the
+- * filename as a relative file: URL. Otherwise, filenames that
+- * contain ":" will not be handled correctly. --mr
+- */
+- QUrl u;
+- u.setProtocol(QString("file"));
+- u.setPath(QString(idxfilename));
+- if (chdir((const char*)u.dirPath()) == -1) chdir("/");
+- QString relname = QString("file:") + u.fileName();
+- QString s=QFileDialog::getSaveFileName(
+- relname,
+- settings().idxfilter,
+- this,
+- "Choose index file...",
+- "Choose the name of the index file" );
+- if (!s) {
+- delete mpg;
+- mpg=0;
+- fileOpenAction->setEnabled(true);
+- return;
+- }
+- idxfilename=(const char*)s;
+- // it's now a relative name that will be canonicalized again soon
+- }
++ /*
++ * BEWARE! UGLY HACK BELOW!
++ *
++ * In order to circumvent the QFileDialog's stupid URL parsing,
++ * we need to first change to the directory and then pass the
++ * filename as a relative file: URL. Otherwise, filenames that
++ * contain ":" will not be handled correctly. --mr
++ */
++ QUrl u;
++ u.setProtocol(QString("file"));
++ u.setPath(QString(idxfilename));
++ if (chdir((const char*)u.dirPath()) == -1) {
++ if(chdir("/") == -1) {
++ critical("Directory wasn't found, and attempting to use / failed.", errormessage);
++ }
++ }
++ QString relname = QString("file:") + u.fileName();
++ QString s=QFileDialog::getSaveFileName(
++ relname,
++ settings().idxfilter,
++ this,
++ "Choose index file...",
++ "Choose the name of the index file" );
++ if (!s) {
++ delete mpg;
++ mpg=0;
++ fileOpenAction->setEnabled(true);
++ return;
++ }
++ idxfilename=(const char*)s;
++ // it's now a relative name that will be canonicalized again soon
++ }
+ }
+
+ make_canonical(idxfilename);
+@@ -1936,7 +1949,7 @@
+ delete mpg;
+ mpg=0;
+ critical("Error creating index - dvbcut",
+- QString("Cannot create index for\n")+filename+":\n"+errorstring);
++ QString("Cannot create index for\n")+filename+":\n"+errorstring);
+ fileOpenAction->setEnabled(true);
+ return;
+ } else if (!errorstring.empty()) {
+@@ -1948,7 +1961,7 @@
+ delete mpg;
+ mpg=0;
+ critical("Invalid MPEG file - dvbcut",
+- QString("The chosen file\n")+filename+"\ndoes not contain any video");
++ QString("The chosen file\n")+filename+"\ndoes not contain any video");
+ fileOpenAction->setEnabled(true);
+ return;
+ }
+@@ -2005,35 +2018,35 @@
+
+ if (!domdoc.isNull()) {
+ QDomElement e;
+- for (QDomNode n=domdoc.documentElement().firstChild();!n.isNull();n=n.nextSibling())
++ for (QDomNode n=domdoc.documentElement().firstChild();!n.isNull();n=n.nextSibling()) {
+ if (!(e=n.toElement()).isNull()) {
+- EventListItem::eventtype evt;
+- if (e.tagName()=="start")
+- evt=EventListItem::start;
+- else if (e.tagName()=="stop")
+- evt=EventListItem::stop;
+- else if (e.tagName()=="chapter")
+- evt=EventListItem::chapter;
+- else if (e.tagName()=="bookmark")
+- evt=EventListItem::bookmark;
+- else
+- continue;
+- bool okay=false;
+- int picnum;
+- QString str=e.attribute("picture","-1");
+- if (str.contains(':') || str.contains('.')) {
+- okay=true;
+- picnum=string2pts(str)/getTimePerFrame();
+- }
+- else
+- picnum=str.toInt(&okay,0);
+- if (okay && picnum>=0 && picnum<pictures) {
+- new EventListItem(eventlist,imgp->getimage(picnum),evt,picnum,(*mpg)[picnum].getpicturetype(),(*mpg)[picnum].getpts()-firstpts);
+- qApp->processEvents();
++ EventListItem::eventtype evt;
++ if (e.tagName()=="start")
++ evt=EventListItem::start;
++ else if (e.tagName()=="stop")
++ evt=EventListItem::stop;
++ else if (e.tagName()=="chapter")
++ evt=EventListItem::chapter;
++ else if (e.tagName()=="bookmark")
++ evt=EventListItem::bookmark;
++ else
++ continue;
++ bool okay=false;
++ int picnum;
++ QString str=e.attribute("picture","-1");
++ if (str.contains(':') || str.contains('.')) {
++ okay=true;
++ picnum=string2pts(str)/getTimePerFrame();
++ }
++ else
++ picnum=str.toInt(&okay,0);
++ if (okay && picnum>=0 && picnum<pictures) {
++ new EventListItem(eventlist,imgp->getimage(picnum),evt,picnum,(*mpg)[picnum].getpicturetype(),(*mpg)[picnum].getpts()-firstpts);
++ qApp->processEvents();
++ }
+ }
+ }
+ }
+-
+ update_quick_picture_lookup_table();
+
+ fileOpenAction->setEnabled(true);
+@@ -2169,14 +2182,14 @@
+ incr = settings().wheel_increments[incr];
+ if (incr != 0) {
+ bool save = fine;
+- // use fine positioning if incr is small
++ // use fine positioning if incr is small
+ fine = (incr < 0 ? -incr : incr) < settings().wheel_threshold;
+- // Note: delta is a multiple of 120 (see Qt documentation)
++ // Note: delta is a multiple of 120 (see Qt documentation)
+ int newpos = curpic - (delta * incr) / settings().wheel_delta;
+ if (newpos < 0)
+- newpos = 0;
+- else if (newpos >= pictures)
+- newpos = pictures - 1;
++ newpos = 0;
++ else if (newpos >= pictures)
++ newpos = pictures - 1;
+ linslider->setValue(newpos);
+ fine = save;
+ }
+@@ -2286,9 +2299,9 @@
+ goinput->setText(QString::number(curpic));
+ goinput2->setText(QString::number(outpic));
+
+- int res=idx.getresolution(); // are found video resolutions stored in index?
+- if (res) {
+- // new index with resolution bits set and lookup table at the end
++ int res=idx.getresolution(); // are found video resolutions stored in index?
++ if (res) {
++ // new index with resolution bits set and lookup table at the end
+ picinfolabel->setText(QString::number(mpg->getwidth(res)) + "x"
+ + QString::number(mpg->getheight(res)));
+ } else {
+@@ -2335,11 +2348,11 @@
+ const EventListItem &eli=*static_cast<const EventListItem*>(item);
+ switch (eli.geteventtype()) {
+ case EventListItem::start:
+- if (startpic<0 || (start_bof && startpic==0 && !realzero)) {
++ if (startpic<0 || (start_bof && startpic==0 && !realzero)) {
+ startpic=eli.getpicture();
+ startpts=eli.getpts();
+ if (startpic==0)
+- realzero=true;
++ realzero=true;
+ // did we have a chapter in the eventlist directly before?
+ if(lastchapter==startpic)
+ chapterlist.push_back(outpts);
+@@ -2359,9 +2372,9 @@
+ break;
+ case EventListItem::chapter:
+ lastchapter=eli.getpicture();
+- if (startpic>=0)
+- chapterlist.push_back(eli.getpts()-startpts+outpts);
+- break;
++ if (startpic>=0)
++ chapterlist.push_back(eli.getpts()-startpts+outpts);
++ break;
+ default:
+ break;
+ }
+diff -ur dvbcut-svn179.orig/src/index.cpp dvbcut-svn179/src/index.cpp
+--- dvbcut-svn179.orig/src/index.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/index.cpp 2016-11-05 18:14:00.488888856 +1100
+@@ -308,7 +308,7 @@
+ pts_t ptsdelta = pts - p[lastiframe].getpts();
+ int pdelta = pictures - lastiframe + seqnr - p[lastiframe].getsequencenumber();
+ if (pdelta * framepts < ptsdelta)
+- fprintf(stderr, "missing frames in GOP (%d, %d): %lld\n",
++ fprintf(stderr, "missing frames in GOP (%d, %d): %ld\n",
+ lastiframe, pictures, ptsdelta / framepts - pdelta);
+ }
+ lastiframe = pictures;
+diff -ur dvbcut-svn179.orig/src/lavfmuxer.cpp dvbcut-svn179/src/lavfmuxer.cpp
+--- dvbcut-svn179.orig/src/lavfmuxer.cpp 2016-11-05 19:09:50.374119795 +1100
++++ dvbcut-svn179/src/lavfmuxer.cpp 2016-11-05 18:14:00.497888699 +1100
+@@ -48,6 +48,7 @@
+ // maybe: AVFormatContext::audio_preload but no direct access.
+ // AVOptions
+ // iformat
++fprintf(stderr," lavfmuxer: need code: mux_rate\n");
+ #else
+ avfc->preload= (int)(.5*AV_TIME_BASE);
+ avfc->mux_rate=10080000;
+@@ -67,7 +68,8 @@
+ mpg.setvideoencodingparameters();
+ s->codec=mpg.getavcc(VIDEOSTREAM);
+ s->codec->rc_buffer_size = 224*1024*8;
+-#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(21<<8)+0)
++#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52, 21, 0)
++fprintf(stderr," lavfmuxer: b4 sample_aspect_ratio\n");
+ s->sample_aspect_ratio = s->codec->sample_aspect_ratio;
+ #endif
+
+@@ -81,24 +83,37 @@
+ if (s->codec)
+ av_free(s->codec);
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
+-// todo: what here ?
+-// maybe need non NULL passed
+-// AVCodecContext* avcodec_alloc_context3 ( const AVCodec * codec )
+- s->codec = avcodec_alloc_context3(NULL);
+-
+-// attribute_deprecated void avcodec_get_context_defaults ( AVCodecContext * s )
+- avcodec_get_context_defaults3(s->codec, NULL);
+-
++/*
++AVCodecContext* avcodec_alloc_context (void)
++Deprecated: use avcodec_alloc_context3():
++AVCodecContext* avcodec_alloc_context3(const AVCodec * codec)
++*/
++fprintf(stderr," lavfmuxer: b4 avcodec_alloc_context3\n");
++ AVCodec* avcodec = avcodec_find_decoder(AV_CODEC_ID_AC3);
++ s->codec = avcodec_alloc_context3(avcodec);
++/*
++void avcodec_get_context_defaults(AVCodecContext * s)
++Deprecated: use avcodec_get_context_defaults3:
++int avcodec_get_context_defaults3(AVCodecContext * s, const AVCodec * codec)
++*/
++fprintf(stderr," lavfmuxer: b4 avcodec_get_context_defaults3\n");
++ int getContext_result = avcodec_get_context_defaults3(s->codec, avcodec);
++ if(getContext_result <= 10) { // todo just testing this works
++ fprintf(stderr, " avcodec_get_context_defaults3 returned=%d\n", getContext_result);
++ }
+ #else
++fprintf(stderr," lavfmuxer: b4 avcodec_get_context_defaults3.alt\n");
+ s->codec = avcodec_alloc_context();
+ avcodec_get_context_defaults(s->codec);
+ #endif
+- s->codec->codec_type=AVMEDIA_TYPE_AUDIO;
++ s->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ s->codec->codec_id = (mpg.getstreamtype(astr)==streamtype::ac3audio) ?
+- CODEC_ID_AC3 : CODEC_ID_MP2;
++ AV_CODEC_ID_AC3 : AV_CODEC_ID_MP2;
++fprintf(stderr," lavfmuxer: b4 rc_buffer_size\n");
+ s->codec->rc_buffer_size = 224*1024*8;
+
+ // Must read some packets to get codec parameters
++fprintf(stderr," lavfmuxer: b4 newstream\n");
+ streamhandle sh(mpg.getinitialoffset());
+ streamdata *sd=sh.newstream(astr,mpg.getstreamtype(astr),mpg.istransportstream());
+
+@@ -107,46 +122,70 @@
+ break;
+
+ if (sd->getitemlistsize() > 1) {
+-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
+-// todo:
+-//int avcodec_open2 ( AVCodecContext * avctx,
+-// const AVCodec * codec,
+-// AVDictionary ** options
+-// )
+- if (!avcodec_open2(s->codec,
+- avcodec_find_decoder(s->codec->codec_id), NULL)) {
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
++/*
++int avcodec_open (AVCodecContext * avctx, AVCodec * codec)
++Deprecated: use avcodec_open2(): doxygen/0.7/
++int avcodec_open2(AVCodecContext * avctx, const AVCodec * codec, AVDictionary ** options)
++*/
++fprintf(stderr," lavfmuxer: b4 codec_options\n");
++ AVDictionary *codec_options = NULL;
++ if (avcodec_open2(s->codec,
++ avcodec_find_decoder(s->codec->codec_id), &codec_options) == 0) {
+ #else
+ if (!avcodec_open(s->codec,
+ avcodec_find_decoder(s->codec->codec_id))) {
+ #endif
+
+-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 18, 0)
+-// todo:
+-// FF_API_OLD_DECODE_AUDIO is not defined, so need to work out how to
+-// calc frame_size, or if decode_audio3 needs it
+-// used to be AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000
+-// trying that
+- int16_t samples[192000/sizeof(int16_t)];
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 40, 0)
++/*
++AVCODEC_MAX_AUDIO_FRAME_SIZE is deprecated.
++*/
++#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
++ int16_t samples[MAX_AUDIO_FRAME_SIZE/sizeof(int16_t)];
+ #else
+ int16_t samples[AVCODEC_MAX_AUDIO_FRAME_SIZE/sizeof(int16_t)];
+ #endif
++fprintf(stderr," lavfmuxer: b4 frame_size\n");
+ int frame_size=sizeof(samples);
+ //fprintf(stderr, "** decode audio size=%d\n", sd->inbytes());
+
+-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++/*
++int avcodec_decode_audio (AVCodecContext * avctx, int16_t * samples,
++ int * frame_size_ptr, uint8_t * buf, int buf_size);
++Deprecated: Use avcodec_decode_audio2() instead.
++int avcodec_decode_audio2(AVCodecContext * avctx, int16_t * samples,
++ int * frame_size_ptr, uint8_t * buf, int buf_size);
++Deprecated: Use avcodec_decode_audio3() instead.
++int avcodec_decode_audio3(AVCodecContext * avctx, int16_t * samples,
++ int * frame_size_ptr, AVPacket * avpkt)
++Deprecated: Use avcodec_decode_audio4 instead.
++int avcodec_decode_audio4 (AVCodecContext *avctx, AVFrame *frame,
++ int * got_frame_ptr, const AVPacket * avpkt)
++Deprecated:
++ Use avcodec_send_packet() and avcodec_receive_frame():
++int avcodec_send_packet(AVCodecContext * avctx, const AVPacket * avpkt)
++int avcodec_receive_frame(AVCodecContext * avctx, AVFrame * frame)
++*/
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 25, 0)
+ AVPacket avpkt;
++fprintf(stderr," lavfmuxer: b4 av_init_packet\n");
+ av_init_packet(&avpkt);
+ avpkt.data = (uint8_t*)sd->getdata();
+ avpkt.size = sd->inbytes();
+ // HACK for CorePNG to decode as normal PNG by default
+ avpkt.flags = AV_PKT_FLAG_KEY;
+- avcodec_decode_audio3(s->codec,samples,&frame_size, &avpkt);
+-#elif LIBAVCODEC_VERSION_INT >= ((52<<16)+(0<<8)+0)
+- avcodec_decode_audio2(s->codec,samples,&frame_size,
+- (uint8_t*) sd->getdata(),sd->inbytes());
++ AVFrame * decoded_frame;
++ int got_frame_ptr;
++fprintf(stderr," lavfmuxer: b4 avcodec_decode_audio4\n");
++ avcodec_decode_audio4(s->codec, decoded_frame, &got_frame_ptr, &avpkt);
++// avcodec_decode_audio3(s->codec, samples, &frame_size, &avpkt);
++#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
++ avcodec_decode_audio2(s->codec, samples, &frame_size,
++ (uint8_t*) sd->getdata(), sd->inbytes());
+ #else
+- avcodec_decode_audio(s->codec,samples,&frame_size,
+- (uint8_t*) sd->getdata(),sd->inbytes());
++ avcodec_decode_audio(s->codec, samples, &frame_size,
++ (uint8_t*) sd->getdata(), sd->inbytes());
+ #endif
+ avcodec_close(s->codec);
+ }
+@@ -157,6 +196,7 @@
+
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
+ // error: 'av_set_parameters' was not declared in this scope
++fprintf(stderr," lavfmuxer: b4 avio_open\n");
+ if (!(fmt->flags & AVFMT_NOFILE)&&(avio_open(&avfc->pb, filename, AVIO_FLAG_WRITE) < 0)) {
+ #else
+ if ((av_set_parameters(avfc, NULL) < 0) || (!(fmt->flags & AVFMT_NOFILE)&&(url_fopen(&avfc->pb, filename, URL_WRONLY) < 0))) {
+@@ -170,6 +210,7 @@
+ // maybe: AVFormatContext::audio_preload but no direct access.
+ // AVOptions
+ // iformat
++fprintf(stderr," lavfmuxer: needcode: mux_rate\n");
+ #else
+ avfc->preload= (int)(.5*AV_TIME_BASE);
+ avfc->mux_rate=10080000;
+@@ -177,9 +218,12 @@
+ avfc->max_delay= (int)(.7*AV_TIME_BASE);
+
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++fprintf(stderr," lavfmuxer: b4: av_dump_format\n");
+ av_dump_format(avfc, 0, filename, 1);
+ fileopened=true;
++fprintf(stderr," lavfmuxer: b4: avformat_write_header\n");
+ avformat_write_header(avfc, NULL);
++fprintf(stderr," lavfmuxer: after: avformat_write_header\n");
+ #else
+ dump_format(avfc, 0, filename, 1);
+ fileopened=true;
+@@ -196,7 +240,7 @@
+ if (!(fmt->flags & AVFMT_NOFILE))
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
+ avio_close(avfc->pb);
+-#elif LIBAVFORMAT_VERSION_INT >= ((52<<16)+(0<<8)+0)
++#elif LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52, 0, 0)
+ url_fclose(avfc->pb);
+ #else
+ url_fclose(&avfc->pb);
+diff -ur dvbcut-svn179.orig/src/main.cpp dvbcut-svn179/src/main.cpp
+--- dvbcut-svn179.orig/src/main.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/main.cpp 2016-11-05 18:14:00.488888856 +1100
+@@ -54,7 +54,7 @@
+ void
+ usage_exit(int rv=1) {
+ fprintf(stderr,
+- "Usage ("VERSION_STRING"):\n"
++ " Usage (" VERSION_STRING"):\n"
+ " %s -generateidx [-idx <idxfilename>] [<mpgfilename> ...]\n"
+ " %s -batch [ OPTIONS ] <prjfilename> | <mpgfilename> ...\n\n"
+ "OPTIONS: -cut 4:3|16:9|TS|TS2|<list>, -exp <expfilename>,\n"
+diff -ur dvbcut-svn179.orig/src/mpegmuxer.cpp dvbcut-svn179/src/mpegmuxer.cpp
+--- dvbcut-svn179.orig/src/mpegmuxer.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/mpegmuxer.cpp 2016-11-05 18:14:00.489888838 +1100
+@@ -640,8 +640,8 @@
+ }
+
+ if (len) {
+- fprintf(stderr,"str=%d len=%d aulist.size=%d packlist.size=%d\n",
+- str,len,s->aulist.size(),s->packlist.size());
++ fprintf(stderr,"str=%d len=%d aulist.size=%lu packlist.size=%lu\n",
++ str, len, s->aulist.size(), s->packlist.size());
+ assert(len==0);
+ }
+ }
+Only in dvbcut-svn179/src: mpegmuxer.cpp.c11
+Only in dvbcut-svn179/src: mpegmuxer.o
+diff -ur dvbcut-svn179.orig/src/mpgfile.cpp dvbcut-svn179/src/mpgfile.cpp
+--- dvbcut-svn179.orig/src/mpgfile.cpp 2016-11-05 19:09:50.373119813 +1100
++++ dvbcut-svn179/src/mpgfile.cpp 2016-11-05 18:14:00.491888803 +1100
+@@ -259,9 +259,9 @@
+ S->id=vid;
+ S->allocavcc();
+ S->avcc->codec_type=AVMEDIA_TYPE_VIDEO;
+- S->avcc->codec_id=CODEC_ID_MPEG2VIDEO;
+- S->dec=avcodec_find_decoder(CODEC_ID_MPEG2VIDEO);
+- S->enc=avcodec_find_encoder(CODEC_ID_MPEG2VIDEO);
++ S->avcc->codec_id=AV_CODEC_ID_MPEG2VIDEO;
++ S->dec=avcodec_find_decoder(AV_CODEC_ID_MPEG2VIDEO);
++ S->enc=avcodec_find_encoder(AV_CODEC_ID_MPEG2VIDEO);
+ S->type=streamtype::mpeg2video;
+ }
+
+@@ -629,7 +629,7 @@
+ {
+
+ for(it=sd->itemlist().begin();it!=sd->itemlist().end();++it)
+- fprintf(stderr," fileposition:%lld/%d bufferposition:%d flags:%x pts:%s\n",
++ fprintf(stderr," fileposition:%ld/%d bufferposition:%d flags:%x pts:%s\n",
+ it->fileposition.packetposition(),it->fileposition.packetoffset(),
+ it->bufferposition,it->flags,ptsstring(it->pts).c_str());
+
+@@ -638,7 +638,7 @@
+
+ for(int i=0;i<MAXAVSTREAMS;++i)
+ if (sh.stream[i])
+- fprintf(stderr,"stream %d%s, itemlist.size():%d\n",
++ fprintf(stderr,"stream %d%s, itemlist.size():%lu\n",
+ i,(sh.stream[i]==sd)?"*":"",sh.stream[i]->itemlist().size());
+
+ abort();
+@@ -725,6 +725,11 @@
+ {
+ u_int8_t *buf=(u_int8_t*)m2v.writeptr();
+ int out;
++ int got_packet;
++ AVPacket avpkt;
++ av_init_packet(&avpkt);
++ avpkt.data = NULL;
++ avpkt.size = 0;
+
+ if (!framelist.empty())
+ {
+@@ -733,13 +738,27 @@
+ f->pts=idx[idx.indexnr(start+p)].getpts()-startpts;
+ f->coded_picture_number=f->display_picture_number=p;
+ f->key_frame=(p==0)?1:0;
+-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 35, 0)
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 24, 0)
+ f->pict_type=(p==0)?AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
++/*
++int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size
++ , const AVFrame *pict)
++use avcodec_encode_video2() instead:
++int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt
++ , const AVFrame *frame, int *got_packet_ptr)
++ &f ?
++*/
++ out = avcodec_encode_video2(avcc, &avpkt, f, &got_packet);
++// was: out = avcodec_encode_video2(avcc, buf, m2v.getsize(), f);
+ #else
++ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(50, 0, 0)
++ f->pict_type=(p==0)?AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
++ #else
+ f->pict_type=(p==0)?FF_I_TYPE:FF_P_TYPE;
+-#endif
++ #endif
+ out = avcodec_encode_video(avcc, buf,
+ m2v.getsize(), f);
++#endif
+
+ delete framelist.front();
+ framelist.pop_front();
+@@ -751,8 +770,11 @@
+ else
+ {
+ fprintf(stderr,"trying to call avcodec_encode_video with frame=0\n");
+- out = avcodec_encode_video(avcc, buf,
+- m2v.getsize(), 0);
++/*
++
++*/
++ out = avcodec_encode_video2(avcc, &avpkt, 0, &got_packet);
++// was: out = avcodec_encode_video(avcc, buf, m2v.getsize(), 0);
+ fprintf(stderr,"...back I am.\n");
+
+ if (out<=0)
+@@ -763,8 +785,18 @@
+ pts_t viddts=mux.getdts(VIDEOSTREAM);
+ mux.setdts(VIDEOSTREAM,vidpts);
+ fixtimecode(buf,out,vidpts);
++/*
++AVCodecContext::coded_frame
++use the quality factor packet side data instead.
++*/
++ int sidedata_key_frame = 0;
++ //if (avpkt.flags & AV_PKT_FLAG_KEY)
++ sidedata_key_frame = avpkt.flags & AV_PKT_FLAG_KEY;
++ fprintf(stderr, "sidedata_key_frame=%hhu\n", sidedata_key_frame);
+ mux.putpacket(VIDEOSTREAM,buf,out,vidpts,viddts,
+- (avcc->coded_frame && avcc->coded_frame->key_frame)?MUXER_FLAG_KEY:0 );
++ (sidedata_key_frame)?MUXER_FLAG_KEY:0 );
++// orig: mux.putpacket(VIDEOSTREAM,buf,out,vidpts,viddts,
++// (avcc->coded_frame && avcc->coded_frame->key_frame)?MUXER_FLAG_KEY:0 );
+ ++outpicture;
+
+ if (log && savepics>0)
+diff -ur dvbcut-svn179.orig/src/stream.h dvbcut-svn179/src/stream.h
+--- dvbcut-svn179.orig/src/stream.h 2016-11-05 19:09:50.373119813 +1100
++++ dvbcut-svn179/src/stream.h 2016-11-05 18:14:00.479889014 +1100
+@@ -68,11 +68,31 @@
+ avcc->rc_min_rate=9500000;
+ avcc->rc_max_rate=9500000;
+ avcc->rc_buffer_size=224*1024*8;
+- avcc->rc_buffer_aggressivity=1.0;
++/* ffmpeg info:
++https://libav.org/documentation/doxygen/master/structAVCodecContext.html
++attribute_deprecated float AVCodecContext::rc_buffer_aggressivity
++
++Deprecated:
++ use encoder private options instead
++ Also:
++http://video.stackexchange.com/questions/18371/avconv-what-are-the-mpegvideo-private-options
++.. "rc_buf_aggressivity", "currently useless",
++*/
++// assume default is OK, comment out.
++// avcc->rc_buffer_aggressivity=1.0;
+ avcc->rc_initial_buffer_occupancy = avcc->rc_buffer_size*3/4;
+ avcc->qmax=2;
+ avcc->mb_lmax= FF_QP2LAMBDA * 2;
+- avcc->lmax= FF_QP2LAMBDA * 2;
++/* ffmpeg info:
++https://libav.org/documentation/doxygen/master/structAVCodecContext.html
++attribute_deprecated int AVCodecContext::lmax
++
++Deprecated:
++ use encoder private options instead
++.. "lmax", "maximum Lagrange factor (VBR)",
++*/
++// assume default is OK, so just comment out.
++// avcc->lmax= FF_QP2LAMBDA * 2;
+ if (interlaced)
+ avcc->flags |= CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME;
+ }
+diff -ur dvbcut-svn179.orig/src/tsfile.cpp dvbcut-svn179/src/tsfile.cpp
+--- dvbcut-svn179.orig/src/tsfile.cpp 2012-08-20 00:00:04.000000000 +1000
++++ dvbcut-svn179/src/tsfile.cpp 2016-11-05 18:14:00.490888821 +1100
+@@ -137,7 +137,8 @@
+ int pd=buf.providedata(packetsize,packetpos);
+ if (pd<0)
+ return pd;
+- if (pd<packetsize)
++ // int < unsigned int
++ if (static_cast<unsigned int>(pd) < packetsize)
+ return returnvalue;
+ }
+
+@@ -349,7 +350,7 @@
+ && bnum<TF5XXXPVR_MAX) {
+ // bookmark is stored in 128 resp. 94kbyte units
+ bookmark*=unit;
+- if(verbose) fprintf(stderr,"BOOKMARK[%d] = %lld\n",bnum,bookmark);
++ if(verbose) fprintf(stderr,"BOOKMARK[%d] = %ld\n",bnum,bookmark);
+ // fill bookmark vector with byte positions
+ byte_bookmarks.push_back(bookmark);
+ bnum++;
+@@ -403,7 +404,7 @@
+ // changed byte order compared to old receivers!?!
+ while ((bookmark=(buffer[boff+3]<<24)|(buffer[boff+2]<<16)|(buffer[boff+1]<<8)|buffer[boff])
+ && bnum<TF7700HDPVR_MAX) {
+- if(verbose) fprintf(stderr,"BOOKMARK[%d] = %lld\n",bnum,bookmark);
++ if(verbose) fprintf(stderr,"BOOKMARK[%d] = %ld\n",bnum,bookmark);
+ // bookmark is stored in seconds now, but we'll use full pts!
+ bookmark*=unit;
+ // fill bookmark vector with times
+@@ -412,7 +413,7 @@
+ boff+=4;
+ }
+ } else // receiver model identified but file to short!
+- fprintf(stderr,"ADD-File probabely corrupted (%dbytes to short), discarding bookmarks!\n",TF7700HDPVR_LEN-len);
++ fprintf(stderr,"ADD-File probably corrupted (%ld bytes too short), discarding bookmarks!\n",TF7700HDPVR_LEN-len);
+
+ // terminate
+ free(buffer);
diff --git a/dvbcut.spec b/dvbcut.spec
index fba7028..51c845b 100644
--- a/dvbcut.spec
+++ b/dvbcut.spec
@@ -7,7 +7,7 @@
Name: dvbcut
Version: 0.6.1
-Release: 18.svn%{svnrev}%{?dist}
+Release: 19.svn%{svnrev}%{?dist}
Summary: Clip and convert DVB transport streams to MPEG2 program streams
Group: Applications/Multimedia
@@ -32,6 +32,7 @@ Patch6: %{name}-179-vs-ubuntu-12.04.diff
Patch7: %{name}-svn179-ffmpeg-0.11.1.patch
Patch8: %{name}-svn179-ffmpeg-2.0-compatibility.patch
Patch9: %{name}-svn179-ffmpeg-2.4.3-compatibility.patch
+Patch10: %{name}-svn179-ffmpeg-3.0.3-compatibility.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: autoconf
@@ -70,6 +71,7 @@ dvbcut can use Mplayer if available.
%patch7 -p1 -b .ffmpeg-0.11.1
%patch8 -b .ffmpeg-2.0
%patch9 -p1 -b .ffmpeg-2.4.3
+%patch10 -p1 -b .ffmpeg-3.0.3
# Fix QTDIR libs in configure
sed -i 's,$QTDIR/$mr_libdirname,$QTDIR/lib,' configure.in
@@ -139,6 +141,16 @@ update-desktop-database &> /dev/null || :
%changelog
+* Sat Nov 5 2016 David Timms <iinet.net.au at dtimms> - 0.6.1-19.svn179
+- rebuild for ffmpeg-3.0.3
+- add combined patch covering:
+- ffmpeg-3.0.3 for removed deprecated definitions and functions.
+- signed-unsigned comparison warnings.
+- whitespace alignment warnings.
+- replace tabs with spaces to match existing source files.
+- c++ compiler c11 fixes (not compatble with <=F23).
+- unused variables.
+
* Mon Oct 20 2014 David Timms <iinet.net.au at dtimms> - 0.6.1-18.svn179
- add patch for ffmpeg-2.4.3 for dropped av_new_stream().
8 years