Gentoo Archives: gentoo-commits

From: "Alexis Ballier (aballier)" <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-video/cinelerra/files: cinelerra-ffmpeg.patch
Date: Mon, 06 Oct 2008 22:25:55
Message-Id: E1KmyWX-0001Ld-8N@stork.gentoo.org
1 aballier 08/10/06 22:25:53
2
3 Added: cinelerra-ffmpeg.patch
4 Log:
5 add fix from upstream to build with ffmpeg trunk
6 (Portage version: 2.2_rc11/cvs/Linux 2.6.26.5 x86_64)
7
8 Revision Changes Path
9 1.1 media-video/cinelerra/files/cinelerra-ffmpeg.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-video/cinelerra/files/cinelerra-ffmpeg.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-video/cinelerra/files/cinelerra-ffmpeg.patch?rev=1.1&content-type=text/plain
13
14 Index: cinelerra-ffmpeg.patch
15 ===================================================================
16 commit 51a020685ef40489cdfdd16e7dcb9e7b5dbb64d5
17 Author: Frans de Boer <frans@×××××××.nl>
18 Date: Sun Sep 28 23:38:48 2008 +0200
19
20 Fix for new FFmpeg API.
21
22 This patch was proposed by Rafael2k and augmented by Nicolas to
23 cope with FFmpeg version 51 as well as version 52.
24
25 diff --git a/quicktime/mpeg4.c b/quicktime/mpeg4.c
26 index d418f66..bab1ac0 100644
27 --- a/quicktime/mpeg4.c
28 +++ b/quicktime/mpeg4.c
29 @@ -671,7 +671,11 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track)
30
31 context->b_quant_factor = 1.25;
32 context->b_quant_offset = 1.25;
33 +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
34 context->error_resilience = FF_ER_CAREFUL;
35 +#else
36 + context->error_recognition = FF_ER_CAREFUL;
37 +#endif
38 context->error_concealment = 3;
39 context->frame_skip_cmp = FF_CMP_DCTMAX;
40 context->ildct_cmp = FF_CMP_VSAD;
41 diff --git a/quicktime/wma.c b/quicktime/wma.c
42 index 6ceefe5..07348a4 100644
43 --- a/quicktime/wma.c
44 +++ b/quicktime/wma.c
45 @@ -187,11 +187,21 @@ printf("decode 2 %x %llx %llx\n", chunk_size, chunk_offset, chunk_offset + chunk
46
47 // Decode chunk into work buffer.
48 pthread_mutex_lock(&ffmpeg_lock);
49 +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
50 result = avcodec_decode_audio(codec->decoder_context,
51 (int16_t*)(codec->work_buffer + codec->output_size * sample_size),
52 - &bytes_decoded,
53 - codec->packet_buffer,
54 + &bytes_decoded,
55 + codec->packet_buffer,
56 chunk_size);
57 +#else
58 + bytes_decoded = AVCODEC_MAX_AUDIO_FRAME_SIZE;
59 + result = avcodec_decode_audio2(codec->decoder_context,
60 + (int16_t*)(codec->work_buffer + codec->output_size * sample_size),
61 + &bytes_decoded,
62 + codec->packet_buffer,
63 + chunk_size);
64 +#endif
65 +
66 pthread_mutex_unlock(&ffmpeg_lock);
67 if(bytes_decoded <= 0)
68 {