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-libs/FusionSound/files: FusionSound-1.1.1-ffmpeg-0.10.patch
Date: Sat, 25 Feb 2012 23:38:30
Message-Id: 20120225233820.2E36E2004B@flycatcher.gentoo.org
1 aballier 12/02/25 23:38:20
2
3 Added: FusionSound-1.1.1-ffmpeg-0.10.patch
4 Log:
5 fix build with ffmpeg-0.10, bug #405721
6
7 (Portage version: 2.2.0_alpha89/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 media-libs/FusionSound/files/FusionSound-1.1.1-ffmpeg-0.10.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/FusionSound/files/FusionSound-1.1.1-ffmpeg-0.10.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/FusionSound/files/FusionSound-1.1.1-ffmpeg-0.10.patch?rev=1.1&content-type=text/plain
14
15 Index: FusionSound-1.1.1-ffmpeg-0.10.patch
16 ===================================================================
17 Parts of:
18 http://cvs.pld-linux.org/cgi-bin/viewvc.cgi/cvs/packages/FusionSound/FusionSound-ffmpeg.patch?view=markup
19
20 and remove a write only variable.
21 https://bugs.gentoo.org/show_bug.cgi?id=405721
22
23 Index: FusionSound-1.1.1/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c
24 ===================================================================
25 --- FusionSound-1.1.1.orig/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c
26 +++ FusionSound-1.1.1/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c
27 @@ -41,6 +41,7 @@
28
29 #include <misc/sound_util.h>
30
31 +#define FF_API_OLD_METADATA2 0
32 #include <libavcodec/avcodec.h>
33 #include <libavformat/avformat.h>
34
35 @@ -476,17 +477,26 @@ static DFBResult
36 IFusionSoundMusicProvider_FFmpeg_GetTrackDescription( IFusionSoundMusicProvider *thiz,
37 FSTrackDescription *desc )
38 {
39 + AVDictionaryEntry *tag = NULL;
40 +
41 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
42
43 if (!desc)
44 return DFB_INVARG;
45
46 - direct_snputs( desc->artist, data->ctx->author, FS_TRACK_DESC_ARTIST_LENGTH );
47 - direct_snputs( desc->title, data->ctx->title, FS_TRACK_DESC_TITLE_LENGTH );
48 - direct_snputs( desc->album, data->ctx->album, FS_TRACK_DESC_ALBUM_LENGTH );
49 - direct_snputs( desc->genre, data->ctx->genre, FS_TRACK_DESC_GENRE_LENGTH );
50 - direct_snputs( desc->encoding, data->codec->codec->name, FS_TRACK_DESC_ENCODING_LENGTH );
51 - desc->year = data->ctx->year;
52 + tag = av_dict_get(data->ctx->metadata, "artist", NULL, 0);
53 + if (tag) direct_snputs( desc->artist, tag->value, FS_TRACK_DESC_ARTIST_LENGTH );
54 + tag = av_dict_get(data->ctx->metadata, "title", NULL, 0);
55 + if (tag) direct_snputs( desc->title, tag->value, FS_TRACK_DESC_TITLE_LENGTH );
56 + tag = av_dict_get(data->ctx->metadata, "album", NULL, 0);
57 + if (tag) direct_snputs( desc->album, tag->value, FS_TRACK_DESC_ALBUM_LENGTH );
58 + tag = av_dict_get(data->ctx->metadata, "genre", NULL, 0);
59 + if (tag) direct_snputs( desc->genre, tag->value, FS_TRACK_DESC_GENRE_LENGTH );
60 + tag = av_dict_get(data->ctx->metadata, "encoding", NULL, 0);
61 + if (tag) direct_snputs( desc->encoding, tag->value, FS_TRACK_DESC_ENCODING_LENGTH );
62 + tag = av_dict_get(data->ctx->metadata, "year", NULL, 0);
63 + if (tag) desc->year = atoi(tag->value);
64 +
65 desc->bitrate = data->codec->bit_rate;
66 desc->replaygain = desc->replaygain_album = 0;
67
68 @@ -540,7 +550,6 @@ FFmpegStreamThread( DirectThread *thread
69 IFusionSoundMusicProvider_FFmpeg_data *data = ctx;
70
71 AVPacket pkt;
72 - u8 *pkt_data = NULL;
73 int pkt_size = 0;
74 s64 pkt_pts = AV_NOPTS_VALUE;
75
76 @@ -584,7 +593,6 @@ FFmpegStreamThread( DirectThread *thread
77 continue;
78 }
79
80 - pkt_data = pkt.data;
81 pkt_size = pkt.size;
82 pkt_pts = pkt.pts;
83 if (pkt_pts != AV_NOPTS_VALUE) {
84 @@ -595,14 +603,13 @@ FFmpegStreamThread( DirectThread *thread
85 }
86
87 len = AVCODEC_MAX_AUDIO_FRAME_SIZE;
88 - decoded = avcodec_decode_audio2( data->codec,
89 - (s16*)data->buf, &len, pkt_data, pkt_size );
90 + decoded = avcodec_decode_audio3( data->codec,
91 + (s16*)data->buf, &len, &pkt );
92 if (decoded < 0) {
93 av_free_packet( &pkt );
94 pkt_size = 0;
95 }
96 else {
97 - pkt_data += decoded;
98 pkt_size -= decoded;
99 if (pkt_size <= 0)
100 av_free_packet( &pkt );
101 @@ -739,7 +746,6 @@ FFmpegBufferThread( DirectThread *thread
102 IFusionSoundMusicProvider_FFmpeg_data *data = ctx;
103
104 AVPacket pkt;
105 - u8 *pkt_data = NULL;
106 int pkt_size = 0;
107 s64 pkt_pts = AV_NOPTS_VALUE;
108 int pos = 0;
109 @@ -789,7 +795,6 @@ FFmpegBufferThread( DirectThread *thread
110 continue;
111 }
112
113 - pkt_data = pkt.data;
114 pkt_size = pkt.size;
115 pkt_pts = pkt.pts;
116 if (pkt_pts != AV_NOPTS_VALUE) {
117 @@ -800,14 +805,13 @@ FFmpegBufferThread( DirectThread *thread
118 }
119
120 len = AVCODEC_MAX_AUDIO_FRAME_SIZE;
121 - decoded = avcodec_decode_audio2( data->codec,
122 - (s16*)data->buf, &len, pkt_data, pkt_size );
123 + decoded = avcodec_decode_audio3( data->codec,
124 + (s16*)data->buf, &len, &pkt );
125 if (decoded < 0) {
126 av_free_packet( &pkt );
127 pkt_size = 0;
128 }
129 else {
130 - pkt_data += decoded;
131 pkt_size -= decoded;
132 if (pkt_size <= 0)
133 av_free_packet( &pkt );
134 @@ -1208,7 +1212,7 @@ Construct( IFusionSoundMusicProvider *th
135 }
136
137 for (i = 0; i < data->ctx->nb_streams; i++) {
138 - if (data->ctx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) {
139 + if (data->ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
140 if (!data->st || data->st->codec->bit_rate < data->ctx->streams[i]->codec->bit_rate)
141 data->st = data->ctx->streams[i];
142 }