[dvbcut] Revert "package is unmaintained - rhbz#4212"

Nicolas Chauvet kwizart at rpmfusion.org
Mon Nov 21 12:14:35 CET 2016


commit bbf1a250cbbaee2054e3acc1dbf23b978b0c840b
Author: Nicolas Chauvet <kwizart at 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?revision=1.2&root=free
+# 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@/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 at gmail.com> - 0.6.1-17.svn179
+- Rebuilt for FFmpeg 2.4.x
+
+* Thu Aug 07 2014 Sérgio Basto <sergio at serjux.com> - 0.6.1-16.svn179
+- Rebuilt for ffmpeg-2.3
+
+* Sat Mar 29 2014 Sérgio Basto <sergio at serjux.com> - 0.6.1-15.svn179
+- Rebuilt for ffmpeg-2.2
+
+* Mon Sep 30 2013 Nicolas Chauvet <kwizart at 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 at gmail.com> - 0.6.1-12.svn179
+- Rebuilt for FFmpeg 2.0.x
+
+* Sun May 26 2013 Nicolas Chauvet <kwizart at 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 at gmail.com> - 0.6.1-9.svn179
+- https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Sat Nov 24 2012 Nicolas Chauvet <kwizart at 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 at gmail.com> - 0.6.1-6.svn178
+- Rebuilt for FFmpeg
+
+* Wed May 23 2012 Nicolas Chauvet <kwizart at gmail.com> - 0.6.1-5.svn178
+- Fix FTBFS with gcc47
+
+* Tue Feb 28 2012 Nicolas Chauvet <kwizart at gmail.com> - 0.6.1-4.svn178
+- Rebuilt for x264/FFmpeg
+
+* Wed Feb 08 2012 Nicolas Chauvet <kwizart at 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 at 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


More information about the rpmfusion-commits mailing list