updated on Mon Jan 16 12:07:49 UTC 2012
[aur-mirror.git] / fusionsound-git / FusionSound.patch
blob007aa442e694dc5a66219b7b915a6de5adeba012
1 From a1ef9036d453b3c9d9aee80086ef0c9f32e7ba34 Mon Sep 17 00:00:00 2001
2 From: kennytm <kennytm@gmail.com>
3 Date: Thu, 8 Dec 2011 02:46:55 +0800
4 Subject: [PATCH] Patches for compilation on Debian sid.
6 ---
7 .../ifusionsoundmusicprovider_ffmpeg.c | 23 ++++++++++---------
8 src/core/core_sound.c | 4 +-
9 2 files changed, 14 insertions(+), 13 deletions(-)
11 diff --git a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c
12 index 6ec5317..40d4266 100644
13 --- a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c
14 +++ b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c
15 @@ -41,6 +41,7 @@
17 #include <misc/sound_util.h>
19 +#define FF_API_OLD_METADATA2 0
20 #include <libavcodec/avcodec.h>
21 #include <libavformat/avformat.h>
23 @@ -64,7 +65,7 @@ typedef struct {
25 DirectStream *stream;
27 - ByteIOContext pb;
28 + AVIOContext pb;
29 AVFormatContext *ctx;
30 AVStream *st;
31 void *iobuf;
32 @@ -481,12 +482,12 @@ IFusionSoundMusicProvider_FFmpeg_GetTrackDescription( IFusionSoundMusicProvider
33 if (!desc)
34 return DR_INVARG;
36 - direct_snputs( desc->artist, data->ctx->author, FS_TRACK_DESC_ARTIST_LENGTH );
37 - direct_snputs( desc->title, data->ctx->title, FS_TRACK_DESC_TITLE_LENGTH );
38 - direct_snputs( desc->album, data->ctx->album, FS_TRACK_DESC_ALBUM_LENGTH );
39 - direct_snputs( desc->genre, data->ctx->genre, FS_TRACK_DESC_GENRE_LENGTH );
40 +// direct_snputs( desc->artist, data->ctx->author, FS_TRACK_DESC_ARTIST_LENGTH );
41 +// direct_snputs( desc->title, data->ctx->title, FS_TRACK_DESC_TITLE_LENGTH );
42 +// direct_snputs( desc->album, data->ctx->album, FS_TRACK_DESC_ALBUM_LENGTH );
43 +// direct_snputs( desc->genre, data->ctx->genre, FS_TRACK_DESC_GENRE_LENGTH );
44 direct_snputs( desc->encoding, data->codec->codec->name, FS_TRACK_DESC_ENCODING_LENGTH );
45 - desc->year = data->ctx->year;
46 +// desc->year = data->ctx->year;
47 desc->bitrate = data->codec->bit_rate;
48 desc->replaygain = desc->replaygain_album = 0;
50 @@ -595,8 +596,8 @@ FFmpegStreamThread( DirectThread *thread, void *ctx )
53 len = AVCODEC_MAX_AUDIO_FRAME_SIZE;
54 - decoded = avcodec_decode_audio2( data->codec,
55 - (s16*)data->buf, &len, pkt_data, pkt_size );
56 + decoded = avcodec_decode_audio3( data->codec,
57 + (s16*)data->buf, &len, &pkt );
58 if (decoded < 0) {
59 av_free_packet( &pkt );
60 pkt_size = 0;
61 @@ -800,8 +801,8 @@ FFmpegBufferThread( DirectThread *thread, void *ctx )
64 len = AVCODEC_MAX_AUDIO_FRAME_SIZE;
65 - decoded = avcodec_decode_audio2( data->codec,
66 - (s16*)data->buf, &len, pkt_data, pkt_size );
67 + decoded = avcodec_decode_audio3( data->codec,
68 + (s16*)data->buf, &len, &pkt );
69 if (decoded < 0) {
70 av_free_packet( &pkt );
71 pkt_size = 0;
72 @@ -1208,7 +1209,7 @@ Construct( IFusionSoundMusicProvider *thiz,
75 for (i = 0; i < data->ctx->nb_streams; i++) {
76 - if (data->ctx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) {
77 + if (data->ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
78 if (!data->st || data->st->codec->bit_rate < data->ctx->streams[i]->codec->bit_rate)
79 data->st = data->ctx->streams[i];
81 diff --git a/src/core/core_sound.c b/src/core/core_sound.c
82 index 4cf6dd9..2ce08a1 100644
83 --- a/src/core/core_sound.c
84 +++ b/src/core/core_sound.c
85 @@ -314,7 +314,7 @@ fs_core_create_buffer( CoreSound *core )
86 D_ASSERT( core->shared->buffer_pool != NULL );
88 /* Create a new object in the buffer pool. */
89 - return (CoreSoundBuffer*) fusion_object_create( core->shared->buffer_pool, core->world );
90 + return (CoreSoundBuffer*) fusion_object_create( core->shared->buffer_pool, core->world, core->fusion_id );
93 CorePlayback *
94 @@ -325,7 +325,7 @@ fs_core_create_playback( CoreSound *core )
95 D_ASSERT( core->shared->playback_pool != NULL );
97 /* Create a new object in the playback pool. */
98 - return (CorePlayback*) fusion_object_create( core->shared->playback_pool, core->world );
99 + return (CorePlayback*) fusion_object_create( core->shared->playback_pool, core->world, core->fusion_id );
102 DirectResult
104 1.7.7.3