Author: kwizart
Update of /cvs/free/rpms/transcode/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv28227
Modified Files:
transcode.spec
Added Files:
transcode-ffmpeg.patch
Log Message:
Add patch from Rathann
transcode-ffmpeg.patch:
export/export_ffmpeg.c | 2 ++
filter/filter_resample.c | 7 +++++++
import/decode_lavc.c | 9 +++++++++
import/import_ffmpeg.c | 9 +++++++++
import/probe_ffmpeg.c | 8 ++++++++
5 files changed, 35 insertions(+)
--- NEW FILE transcode-ffmpeg.patch ---
diff -up transcode-1.1.5/export/export_ffmpeg.c.ffmpeg
transcode-1.1.5/export/export_ffmpeg.c
--- transcode-1.1.5/export/export_ffmpeg.c.ffmpeg 2009-02-21 22:01:57.000000000 +0100
+++ transcode-1.1.5/export/export_ffmpeg.c 2011-09-03 12:39:13.000000000 +0200
@@ -643,8 +643,10 @@ MOD_init
lavc_venc_context->bit_rate = vob->divxbitrate * 1000;
lavc_venc_context->bit_rate_tolerance = lavc_param_vrate_tolerance * 1000;
+#if FF_API_MB_Q
lavc_venc_context->mb_qmin = lavc_param_mb_qmin;
lavc_venc_context->mb_qmax = lavc_param_mb_qmax;
+#endif
lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5);
lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5);
lavc_venc_context->max_qdiff = lavc_param_vqdiff;
diff -up transcode-1.1.5/filter/filter_resample.c.ffmpeg
transcode-1.1.5/filter/filter_resample.c
--- transcode-1.1.5/filter/filter_resample.c.ffmpeg 2009-02-21 22:01:57.000000000 +0100
+++ transcode-1.1.5/filter/filter_resample.c 2011-09-03 13:28:13.000000000 +0200
@@ -110,8 +110,15 @@ static int resample_configure(TCModuleIn
goto abort;
}
+#if FF_API_AUDIO_OLD
pd->resample_ctx = audio_resample_init(vob->a_chan, vob->a_chan,
vob->mp3frequency, vob->a_rate);
+#else
+ pd->resample_ctx = av_audio_resample_init(vob->a_chan, vob->a_chan,
+ vob->mp3frequency, vob->a_rate,
+ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
+ 16, 10, 0, 0.8);
+#endif
if (pd->resample_ctx == NULL) {
tc_log_error(MOD_NAME, "can't get a resample context");
goto abort;
diff -up transcode-1.1.5/import/decode_lavc.c.ffmpeg transcode-1.1.5/import/decode_lavc.c
--- transcode-1.1.5/import/decode_lavc.c.ffmpeg 2009-03-28 09:39:08.000000000 +0100
+++ transcode-1.1.5/import/decode_lavc.c 2011-09-03 12:39:13.000000000 +0200
@@ -261,8 +261,17 @@ void decode_lavc(decode_t *decode)
//tc_log_msg(__FILE__, "SIZE: (%d) MP4(%d) blen(%d) BUF(%d) read(%ld)",
len, mp4_size, buf_len, READ_BUFFER_SIZE, bytes_read);
do {
+#if FF_API_VIDEO_OLD
len = avcodec_decode_video(lavc_dec_context, &picture,
&got_picture, buffer+buf_len, mp4_size-buf_len);
+#else
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = buffer+buf_len;
+ avpkt.size = mp4_size-buf_len;
+ len = avcodec_decode_video2(lavc_dec_context, &picture,
+ &got_picture, &avpkt);
+#endif
if (len < 0) {
tc_log_error(__FILE__, "frame decoding failed");
diff -up transcode-1.1.5/import/import_ffmpeg.c.ffmpeg
transcode-1.1.5/import/import_ffmpeg.c
--- transcode-1.1.5/import/import_ffmpeg.c.ffmpeg 2009-02-21 22:01:57.000000000 +0100
+++ transcode-1.1.5/import/import_ffmpeg.c 2011-09-03 14:09:41.000000000 +0200
@@ -543,8 +543,17 @@ MOD_decode {
retry:
do {
TC_LOCK_LIBAVCODEC;
+#if FF_API_VIDEO_OLD
len = avcodec_decode_video(lavc_dec_context, &picture,
&got_picture, buffer, bytes_read);
+#else
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = buffer;
+ avpkt.size = bytes_read;
+ len = avcodec_decode_video2(lavc_dec_context, &picture,
+ &got_picture, &avpkt);
+#endif
TC_UNLOCK_LIBAVCODEC;
if (len < 0) {
diff -up transcode-1.1.5/import/probe_ffmpeg.c.ffmpeg
transcode-1.1.5/import/probe_ffmpeg.c
--- transcode-1.1.5/import/probe_ffmpeg.c.ffmpeg 2009-03-28 09:39:08.000000000 +0100
+++ transcode-1.1.5/import/probe_ffmpeg.c 2011-09-03 12:39:13.000000000 +0200
@@ -47,7 +47,11 @@ static void translate_info(const AVForma
for (i = 0; i < ctx->nb_streams; i++) {
st = ctx->streams[i];
+#if LIBAVCODEC_VERSION_MAJOR < 53
if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
+#else
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+#endif
info->bitrate = st->codec->bit_rate / 1000;
info->width = st->codec->width;
info->height = st->codec->height;
@@ -65,7 +69,11 @@ static void translate_info(const AVForma
for (i = 0; i < ctx->nb_streams; i++) {
st = ctx->streams[i];
+#if LIBAVCODEC_VERSION_MAJOR < 53
if (st->codec->codec_type == CODEC_TYPE_AUDIO
+#else
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO
+#endif
&& j < TC_MAX_AUD_TRACKS) {
info->track[j].format = 0x1; /* known wrong */
info->track[j].chan = st->codec->channels;
Index: transcode.spec
===================================================================
RCS file: /cvs/free/rpms/transcode/devel/transcode.spec,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- transcode.spec 26 Sep 2011 21:21:47 -0000 1.29
+++ transcode.spec 27 Sep 2011 20:47:11 -0000 1.30
@@ -20,6 +20,7 @@
Patch5: transcode-1.1.5-no_video.patch
Patch6: transcode-1.1.5-videodev2.patch
Patch7: transcode-1.1.5-fix_v4l_1.patch
+Patch8: transcode-ffmpeg.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -78,6 +79,7 @@
%patch5 -p1 -b .no_video
%patch6 -p1 -b .videodev2
%patch7 -p1 -b .fix_v4l_1
+%patch8 -p1 -b .ff08
rm filter/preview/dv_types.h
rm import/v4l/videodev.h
@@ -157,6 +159,7 @@
%changelog
* Mon Sep 26 2011 Nicolas Chauvet <kwizart(a)gmail.com> - 1.1.5-9
- Rebuilt for FFmpeg-0.8
+- Add patch from Rathann
* Wed Aug 24 2011 David Juran <david(a)juran.se> - 1.1.5-8
- Rebuild for new mjpegtools (Bz 1906)