Gentoo Archives: gentoo-commits

From: "Chi-Thanh Christopher Nguyen (chithanh)" <chithanh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-plugins/gnash/files: gnash-0.8.9-no-deprecated-avcodec-decode-video.patch gnash-0.8.9-no-deprecated-avcodec-audio-resample.patch gnash-0.8.9-no-deprecated-avcodec-decode-audio.patch gnash-0.8.9-no-deprecated-avformat-metadata.patch
Date: Sat, 02 Jul 2011 21:09:14
Message-Id: 20110702210902.1BB8E2004B@flycatcher.gentoo.org
1 chithanh 11/07/02 21:09:02
2
3 Added:
4 gnash-0.8.9-no-deprecated-avcodec-decode-video.patch
5 gnash-0.8.9-no-deprecated-avcodec-audio-resample.patch
6 gnash-0.8.9-no-deprecated-avcodec-decode-audio.patch
7 gnash-0.8.9-no-deprecated-avformat-metadata.patch
8 Log:
9 Fix building against ffmpeg-0.8, bug #362949
10
11 (Portage version: 2.2.0_alpha41/cvs/Linux x86_64)
12
13 Revision Changes Path
14 1.1 www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avcodec-decode-video.patch
15
16 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avcodec-decode-video.patch?rev=1.1&view=markup
17 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avcodec-decode-video.patch?rev=1.1&content-type=text/plain
18
19 Index: gnash-0.8.9-no-deprecated-avcodec-decode-video.patch
20 ===================================================================
21 diff -ur a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
22 --- a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp 2011-03-13 17:47:36.000000000 +0100
23 +++ b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp 2011-07-02 21:40:28.026996093 +0200
24 @@ -356,8 +356,12 @@
25
26 int bytes = 0;
27 // no idea why avcodec_decode_video wants a non-const input...
28 - avcodec_decode_video(_videoCodecCtx->getContext(), frame, &bytes,
29 - input, input_size);
30 + AVPacket pkt;
31 + av_init_packet(&pkt);
32 + pkt.data = (uint8_t*) input;
33 + pkt.size = input_size;
34 + avcodec_decode_video2(_videoCodecCtx->getContext(), frame, &bytes,
35 + &pkt);
36
37 if (!bytes) {
38 log_error("Decoding of a video frame failed");
39
40
41
42 1.1 www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avcodec-audio-resample.patch
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avcodec-audio-resample.patch?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avcodec-audio-resample.patch?rev=1.1&content-type=text/plain
46
47 Index: gnash-0.8.9-no-deprecated-avcodec-audio-resample.patch
48 ===================================================================
49 diff -ur a/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp b/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
50 --- a/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp 2011-02-26 19:11:08.000000000 +0100
51 +++ b/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp 2011-07-02 22:45:54.804995296 +0200
52 @@ -46,8 +46,10 @@
53 {
54 if ( (ctx->sample_rate != 44100) || (ctx->channels != 2) ) {
55 if ( ! _context ) {
56 - _context = audio_resample_init(
57 - 2, ctx->channels, 44100, ctx->sample_rate
58 + _context = av_audio_resample_init(
59 + 2, ctx->channels, 44100, ctx->sample_rate,
60 + AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
61 + 16, 10, 0, 0.8
62 );
63 }
64
65
66
67
68 1.1 www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avcodec-decode-audio.patch
69
70 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avcodec-decode-audio.patch?rev=1.1&view=markup
71 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avcodec-decode-audio.patch?rev=1.1&content-type=text/plain
72
73 Index: gnash-0.8.9-no-deprecated-avcodec-decode-audio.patch
74 ===================================================================
75 diff -ur a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
76 --- a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp 2011-02-26 19:11:08.000000000 +0100
77 +++ b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp 2011-07-02 21:03:32.785996541 +0200
78 @@ -29,7 +29,7 @@
79
80 //#define GNASH_DEBUG_AUDIO_DECODING
81
82 -#define AVCODEC_DECODE_AUDIO avcodec_decode_audio2
83 +#define AVCODEC_DECODE_AUDIO avcodec_decode_audio3
84
85 namespace gnash {
86 namespace media {
87 @@ -549,8 +549,12 @@
88 #endif
89
90 // older ffmpeg versions didn't accept a const input..
91 + AVPacket pkt;
92 + av_init_packet(&pkt);
93 + pkt.data = (uint8_t*) input;
94 + pkt.size = inputSize;
95 int tmp = AVCODEC_DECODE_AUDIO(_audioCodecCtx, outPtr, &outSize,
96 - input, inputSize);
97 + &pkt);
98
99 #ifdef GNASH_DEBUG_AUDIO_DECODING
100 log_debug(" avcodec_decode_audio[2](ctx, bufptr, %d, input, %d) "
101
102
103
104 1.1 www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avformat-metadata.patch
105
106 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avformat-metadata.patch?rev=1.1&view=markup
107 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-plugins/gnash/files/gnash-0.8.9-no-deprecated-avformat-metadata.patch?rev=1.1&content-type=text/plain
108
109 Index: gnash-0.8.9-no-deprecated-avformat-metadata.patch
110 ===================================================================
111 diff -ur a/libmedia/ffmpeg/MediaParserFfmpeg.cpp b/libmedia/ffmpeg/MediaParserFfmpeg.cpp
112 --- a/libmedia/ffmpeg/MediaParserFfmpeg.cpp 2011-03-13 17:47:36.000000000 +0100
113 +++ b/libmedia/ffmpeg/MediaParserFfmpeg.cpp 2011-07-02 22:29:55.889995495 +0200
114 @@ -387,7 +387,7 @@
115
116 log_debug("Parsing FFMPEG media file: format:%s; nstreams:%d",
117 _inputFmt->name, _formatCtx->nb_streams);
118 -
119 + /*
120 if ( _formatCtx->title[0] )
121 log_debug(_(" Title:'%s'"), _formatCtx->title);
122 if ( _formatCtx->author[0] )
123 @@ -398,7 +398,7 @@
124 log_debug(_(" Comment:'%s'"), _formatCtx->comment);
125 if ( _formatCtx->album[0] )
126 log_debug(_(" Album:'%s'"), _formatCtx->album);
127 -
128 + */
129 // Find first audio and video stream
130 for (unsigned int i = 0; i < static_cast<unsigned int>(_formatCtx->nb_streams); i++)
131 {
132 @@ -415,7 +415,7 @@
133 }
134
135 switch (enc->codec_type) {
136 - case CODEC_TYPE_AUDIO:
137 + case AVMEDIA_TYPE_AUDIO:
138 if (_audioStreamIndex < 0) {
139 _audioStreamIndex = i;
140 _audioStream = _formatCtx->streams[i];
141 @@ -425,7 +425,7 @@
142 }
143 break;
144
145 - case CODEC_TYPE_VIDEO:
146 + case AVMEDIA_TYPE_VIDEO:
147 if (_videoStreamIndex < 0) {
148 _videoStreamIndex = i;
149 _videoStream = _formatCtx->streams[i];