Author: dtimms
Update of /cvs/free/rpms/dvbcut/devel
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv1826
Modified Files:
dvbcut.spec
Added Files:
dvbcut-svn179-ffmpeg-2.0-compatibility.patch
Log Message:
add patch to use new ffmpeg-2.0 rather than deprecated functions
dvbcut-svn179-ffmpeg-2.0-compatibility.patch:
lavfmuxer.cpp | 32 ++++++++++++++++++++++++++++++++
mpgfile.cpp | 4 ++--
stream.h | 11 +++++++++--
3 files changed, 43 insertions(+), 4 deletions(-)
--- NEW FILE dvbcut-svn179-ffmpeg-2.0-compatibility.patch ---
--- 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);
Index: dvbcut.spec
===================================================================
RCS file: /cvs/free/rpms/dvbcut/devel/dvbcut.spec,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- dvbcut.spec 15 Aug 2013 10:14:49 -0000 1.24
+++ dvbcut.spec 4 Sep 2013 13:34:55 -0000 1.25
@@ -7,7 +7,7 @@
Name: dvbcut
Version: 0.6.1
-Release: 12.svn%{svnrev}%{?dist}
+Release: 13.svn%{svnrev}%{?dist}
Summary: Clip and convert DVB transport streams to MPEG2 program streams
Group: Applications/Multimedia
@@ -30,6 +30,7 @@
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
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: autoconf
@@ -64,8 +65,9 @@
%patch1 -b .fix-make-install
%patch2 -b .fix-help-install
%patch3 -b .desktop-improvements
-%patch6 -b .orig
-%patch7 -p1 -b .orig
+%patch6 -b .ubuntu
+%patch7 -p1 -b .ffmpeg-0.11.1
+%patch8 -b .ffmpeg-2.0
# Fix QTDIR libs in configure
sed -i 's,$QTDIR/$mr_libdirname,$QTDIR/lib,' configure.in
@@ -135,6 +137,9 @@
%changelog
+* 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