Author: dtimms
Update of /cvs/free/rpms/dvbcut/F-17
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv2168
Modified Files:
.cvsignore dvbcut.spec sources
Added Files:
dvbcut-179-vs-ubuntu-12.04.diff
dvbcut-svn179-ffmpeg-0.11.1.patch
Removed Files:
dvbcut-ffmpeg-0.8.2.patch dvbcut-gcc47.patch
Log Message:
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.
dvbcut-179-vs-ubuntu-12.04.diff:
lavfmuxer.cpp | 24 ++++++++++++++++--------
lavfmuxer.h | 2 +-
mpgfile.cpp | 30 ++++++++++++++++++++----------
3 files changed, 37 insertions(+), 19 deletions(-)
--- NEW FILE dvbcut-179-vs-ubuntu-12.04.diff ---
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;
dvbcut-svn179-ffmpeg-0.11.1.patch:
lavfmuxer.cpp | 34 ++++++++++++++++++++++++++++++----
mpgfile.cpp | 5 ++++-
mpgfile.cpp~ |only
3 files changed, 34 insertions(+), 5 deletions(-)
--- NEW FILE dvbcut-svn179-ffmpeg-0.11.1.patch ---
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~
Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/dvbcut/F-17/.cvsignore,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- .cvsignore 5 Sep 2011 14:07:28 -0000 1.6
+++ .cvsignore 1 Sep 2012 13:42:28 -0000 1.7
@@ -1 +1 @@
-dvbcut-svn178.tar.bz2
+dvbcut-svn179.tar.bz2
Index: dvbcut.spec
===================================================================
RCS file: /cvs/free/rpms/dvbcut/F-17/dvbcut.spec,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- dvbcut.spec 23 May 2012 20:33:05 -0000 1.17
+++ dvbcut.spec 1 Sep 2012 13:42:29 -0000 1.18
@@ -1,4 +1,4 @@
-%define svnrev 178
+%define svnrev 179
%if 0%{?fedora} > 6 || 0%{?rhel} > 5
%define qt3 qt3
%else
@@ -7,7 +7,7 @@
Name: dvbcut
Version: 0.6.1
-Release: 5.svn%{svnrev}%{?dist}
+Release: 7.svn%{svnrev}%{?dist}
Summary: Clip and convert DVB transport streams to MPEG2 program streams
Group: Applications/Multimedia
@@ -28,8 +28,8 @@
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
-Patch5: dvbcut-gcc47.patch
+Patch6: %{name}-179-vs-ubuntu-12.04.diff
+Patch7: %{name}-svn179-ffmpeg-0.11.1.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: autoconf
@@ -64,8 +64,8 @@
%patch1 -b .fix-make-install
%patch2 -b .fix-help-install
%patch3 -b .desktop-improvements
-%patch4 -b .ffmpeg
-%patch5 -p1 -b .gcc47
+%patch6 -b .orig
+%patch7 -p1 -b .orig
# Fix QTDIR libs in configure
sed -i 's,$QTDIR/$mr_libdirname,$QTDIR/lib,' configure.in
@@ -96,11 +96,9 @@
desktop-file-install --vendor="" \
--dir %{buildroot}%{_datadir}/applications dvbcut.desktop
-#in future: % {_kde4_servicesdir}, but for now
mkdir -p %{buildroot}%{_kde4_datadir}/kde4/services/
-desktop-file-install \
- --dir=%{buildroot}%{_kde4_datadir}/kde4/services \
- %{SOURCE6}
+cp %{SOURCE6} %{buildroot}%{_kde4_datadir}/kde4/services/
+
%clean
rm -rf %{buildroot}
@@ -137,6 +135,16 @@
%changelog
+* 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
Index: sources
===================================================================
RCS file: /cvs/free/rpms/dvbcut/F-17/sources,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- sources 5 Sep 2011 14:07:29 -0000 1.6
+++ sources 1 Sep 2012 13:42:29 -0000 1.7
@@ -1 +1 @@
-92baf7f9d86f35805519117fb8e04357 dvbcut-svn178.tar.bz2
+467975975bc7bf6abcb559449e776654 dvbcut-svn179.tar.bz2
--- dvbcut-ffmpeg-0.8.2.patch DELETED ---
--- dvbcut-gcc47.patch DELETED ---