rpms/dvbcut/devel dvbcut-ffmpeg-0.8.2.patch, NONE, 1.1 .cvsignore, 1.5, 1.6 dvbcut.spec, 1.12, 1.13 sources, 1.5, 1.6

David Timms dtimms at rpmfusion.org
Mon Sep 5 16:07:29 CEST 2011


Author: dtimms

Update of /cvs/free/rpms/dvbcut/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv1173

Modified Files:
	.cvsignore dvbcut.spec sources 
Added Files:
	dvbcut-ffmpeg-0.8.2.patch 
Log Message:
update to 0.6.1 release post svn178
add patch for ffmpeg-0.8.2


dvbcut-ffmpeg-0.8.2.patch:
 lavfmuxer.cpp |   21 +++++++++++++++++++++
 lavfmuxer.h   |    4 ++++
 mpgfile.cpp   |   22 ++++++++++++++++++++++
 3 files changed, 47 insertions(+)

--- NEW FILE dvbcut-ffmpeg-0.8.2.patch ---
diff -up src/lavfmuxer.cpp.ffmpeg src/lavfmuxer.cpp
--- src/lavfmuxer.cpp.ffmpeg	2011-04-25 03:27:24.000000000 +0200
+++ src/lavfmuxer.cpp	2011-08-24 21:08:28.000000000 +0200
@@ -34,12 +34,20 @@ extern "C" {
 lavfmuxer::lavfmuxer(const char *format, uint32_t audiostreammask, mpgfile &mpg, const char *filename)
     : muxer(), avfc(0), fileopened(false)
   {
+#if FF_API_GUESS_FORMAT
   fmt = guess_format(format, NULL, NULL);
+#else
+  fmt = av_guess_format(format, NULL, NULL);
+#endif
   if (!fmt) {
     return;
     }
 
+#if FF_API_ALLOC_FORMAT_CONTEXT
   avfc=av_alloc_format_context();
+#else
+  avfc=avformat_alloc_context();
+#endif
   if (!avfc)
     return;
 
@@ -73,7 +81,11 @@ lavfmuxer::lavfmuxer(const char *format,
         av_free(s->codec);
       s->codec = avcodec_alloc_context();
       avcodec_get_context_defaults(s->codec);
+#if LIBAVCODEC_VERSION_MAJOR < 53
       s->codec->codec_type=CODEC_TYPE_AUDIO;
+#else
+      s->codec->codec_type=AVMEDIA_TYPE_AUDIO;
+#endif
       s->codec->codec_id = (mpg.getstreamtype(astr)==streamtype::ac3audio) ?
 	CODEC_ID_AC3 : CODEC_ID_MP2;
       s->codec->rc_buffer_size = 224*1024*8;
@@ -92,6 +104,7 @@ lavfmuxer::lavfmuxer(const char *format,
 	    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 FF_API_AUDIO_OLD
 #if LIBAVCODEC_VERSION_INT >= ((52<<16)+(0<<8)+0)
 	    avcodec_decode_audio2
 #else
@@ -99,6 +112,14 @@ lavfmuxer::lavfmuxer(const char *format,
 #endif
 	      (s->codec,samples,&frame_size,
 	       (uint8_t*) sd->getdata(),sd->inbytes());
+#else
+	    AVPacket avpkt;
+	    av_init_packet(&avpkt);
+	    avpkt.data = (uint8_t *) sd->getdata();
+	    avpkt.size = sd->inbytes();
+	    avcodec_decode_audio3
+	      (s->codec,samples,&frame_size,&avpkt);
+#endif
 	    avcodec_close(s->codec);
 	  }
 	  break;
diff -up src/lavfmuxer.h.ffmpeg src/lavfmuxer.h
--- src/lavfmuxer.h.ffmpeg	2011-04-25 03:27:24.000000000 +0200
+++ src/lavfmuxer.h	2011-08-24 19:46:39.000000000 +0200
@@ -73,7 +73,11 @@ public:
     avp.dts=dts;
     avp.stream_index=st[str].stream_index;
     if (flags & MUXER_FLAG_KEY)
+#if LIBAVCODEC_VERSION_MAJOR < 53
       avp.flags |= PKT_FLAG_KEY;
+#else
+      avp.flags |= AV_PKT_FLAG_KEY;
+#endif
 
     int rv=av_interleaved_write_frame(avfc,&avp);
 
diff -up src/mpgfile.cpp.ffmpeg src/mpgfile.cpp
--- src/mpgfile.cpp.ffmpeg	2011-04-25 03:27:24.000000000 +0200
+++ src/mpgfile.cpp	2011-08-24 21:14:54.000000000 +0200
@@ -161,8 +161,17 @@ void mpgfile::decodegop(int start, int s
       while (decodebytes>0)
       {
         frameFinished=0;
+#if FF_API_VIDEO_OLD
         int bytesDecoded=avcodec_decode_video(S->avcc, avf, &frameFinished,
                                               (uint8_t*) data, decodebytes);
+#else
+        AVPacket avpkt;
+        av_init_packet(&avpkt);
+        avpkt.data = (uint8_t *) data;
+        avpkt.size = decodebytes;
+        int bytesDecoded=avcodec_decode_video2(S->avcc, avf, &frameFinished,
+                                               &avpkt);
+#endif
         if (bytesDecoded<0)
         {
           fprintf(stderr,"libavcodec error while decoding frame #%d\n",pic);
@@ -201,7 +210,16 @@ void mpgfile::decodegop(int start, int s
   if (pic < stop)
   {
     int frameFinished=0;
+#if FF_API_VIDEO_OLD
     avcodec_decode_video(S->avcc, avf, &frameFinished, NULL, 0);
+#else
+    AVPacket avpkt;
+    av_init_packet(&avpkt);
+    avpkt.data = NULL;
+    avpkt.size = 0;
+    avcodec_decode_video2(S->avcc, avf, &frameFinished,
+                                           &avpkt);
+#endif
     if (frameFinished)
     {
       if (last_cpn!=avf->coded_picture_number)
@@ -248,7 +266,11 @@ void mpgfile::initcodeccontexts(int vid)
     stream *S=&s[VIDEOSTREAM];
     S->id=vid;
     S->allocavcc();
+#if LIBAVCODEC_VERSION_MAJOR < 53
     S->avcc->codec_type=CODEC_TYPE_VIDEO;
+#else
+    S->avcc->codec_type=AVMEDIA_TYPE_VIDEO;
+#endif
     S->avcc->codec_id=CODEC_ID_MPEG2VIDEO;
     S->dec=avcodec_find_decoder(CODEC_ID_MPEG2VIDEO);
     S->enc=avcodec_find_encoder(CODEC_ID_MPEG2VIDEO);


Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/dvbcut/devel/.cvsignore,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- .cvsignore	26 Apr 2011 02:07:33 -0000	1.5
+++ .cvsignore	5 Sep 2011 14:07:28 -0000	1.6
@@ -1 +1 @@
-dvbcut-svn176.tar.bz2
+dvbcut-svn178.tar.bz2


Index: dvbcut.spec
===================================================================
RCS file: /cvs/free/rpms/dvbcut/devel/dvbcut.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- dvbcut.spec	26 Apr 2011 02:07:33 -0000	1.12
+++ dvbcut.spec	5 Sep 2011 14:07:29 -0000	1.13
@@ -1,4 +1,4 @@
-%define svnrev 176
+%define svnrev 178
 %if 0%{?fedora} > 6
   %define qt3 qt3
 %else
@@ -7,7 +7,7 @@
 
 Name:    dvbcut
 Version: 0.6.1
-Release: 1.svn%{svnrev}%{?dist}
+Release: 2.svn%{svnrev}%{?dist}
 Summary: Clip and convert DVB transport streams to MPEG2 program streams
 
 Group:   Applications/Multimedia
@@ -15,7 +15,7 @@
 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
+#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
@@ -28,6 +28,7 @@
 Patch1:  %{name}-svn176-fix-make-install.patch
 Patch2:  %{name}-svn176-fix-help-install-path.patch
 Patch3:  %{name}-svn176-desktop-additions.patch
+Patch4:  %{name}-ffmpeg-0.8.2.patch
 
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 BuildRequires: autoconf
@@ -49,8 +50,8 @@
 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.
+re-encoded in order to obtain a valid MPEG file. For MPEG video playback
+dvbcut can use Mplayer if available.
 
 
 %prep
@@ -62,6 +63,7 @@
 %patch1 -b .fix-make-install
 %patch2 -b .fix-help-install
 %patch3 -b .desktop-improvements
+%patch4 -b .ffmpeg
 
 # Fix QTDIR libs in configure
 sed -i 's,$QTDIR/$mr_libdirname,$QTDIR/lib,' configure.in
@@ -92,7 +94,7 @@
 desktop-file-install --vendor="" \
     --dir %{buildroot}%{_datadir}/applications dvbcut.desktop
 
-#in future: %{_kde4_servicesdir}, but for now
+#in future: % {_kde4_servicesdir}, but for now
 mkdir -p %{buildroot}%{_kde4_datadir}/kde4/services/ 
 desktop-file-install                                 \
     --dir=%{buildroot}%{_kde4_datadir}/kde4/services \
@@ -133,6 +135,10 @@
 
 
 %changelog
+* 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


Index: sources
===================================================================
RCS file: /cvs/free/rpms/dvbcut/devel/sources,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sources	26 Apr 2011 02:07:33 -0000	1.5
+++ sources	5 Sep 2011 14:07:29 -0000	1.6
@@ -1 +1 @@
-daf673f53f4c3893bd78338a9372cbc4  dvbcut-svn176.tar.bz2
+92baf7f9d86f35805519117fb8e04357  dvbcut-svn178.tar.bz2



More information about the rpmfusion-commits mailing list