]>
Commit | Line | Data |
---|---|---|
7f78b8b0 AM |
1 | --- fs/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c.orig 2011-06-15 20:01:31.000000000 +0200 |
2 | +++ fs/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c 2011-06-15 20:01:45.000000000 +0200 | |
3 | @@ -64,7 +64,7 @@ | |
4 | ||
5 | DirectStream *stream; | |
6 | ||
7 | - ByteIOContext pb; | |
8 | + AVIOContext pb; | |
9 | AVFormatContext *ctx; | |
10 | AVStream *st; | |
11 | void *iobuf; | |
12 | diff -Naurp FusionSound-1.1.1-original/configure.in FusionSound-1.1.1/configure.in | |
13 | --- FusionSound-1.1.1-original/configure.in 2008-02-11 05:31:45.000000000 -0600 | |
14 | +++ FusionSound-1.1.1/configure.in 2009-04-10 15:18:02.000000000 -0600 | |
15 | @@ -513,11 +513,11 @@ AC_ARG_WITH(ffmpeg, | |
16 | ||
17 | if test "x$with_ffmpeg" = "xyes"; then | |
18 | AC_MSG_CHECKING([for libavcodec/libavformat]) | |
19 | - if $PKG_CONFIG libavcodec libavformat; then | |
20 | + if $PKG_CONFIG libavcodec libavformat libavutil; then | |
21 | AC_MSG_RESULT(yes) | |
22 | ffmpeg="yes" | |
23 | - FFMPEG_CFLAGS=`$PKG_CONFIG --cflags libavcodec libavformat` | |
24 | - FFMPEG_LIBS=`$PKG_CONFIG --libs libavcodec libavformat` | |
25 | + FFMPEG_CFLAGS=`$PKG_CONFIG --cflags libavcodec libavformat libavutil` | |
26 | + FFMPEG_LIBS=`$PKG_CONFIG --libs libavcodec libavformat libavutil` | |
27 | else | |
28 | AC_MSG_RESULT(no) | |
29 | AC_MSG_WARN([ | |
30 | diff -Naurp FusionSound-1.1.1-original/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c FusionSound-1.1.1/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c | |
31 | --- FusionSound-1.1.1-original/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c 2008-02-11 05:31:45.000000000 -0600 | |
32 | +++ FusionSound-1.1.1/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c 2009-04-10 15:18:21.000000000 -0600 | |
33 | @@ -41,8 +41,8 @@ | |
34 | ||
35 | #include <misc/sound_util.h> | |
36 | ||
37 | -#include <avcodec.h> | |
38 | -#include <avformat.h> | |
39 | +#include <libavcodec/avcodec.h> | |
40 | +#include <libavformat/avformat.h> | |
41 | ||
42 | static DFBResult | |
43 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ); | |
44 | ||
45 | --- FusionSound-1.1.1.org/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c 2011-09-11 20:21:02.521648411 +0200 | |
46 | +++ FusionSound-1.1.1/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c 2011-09-11 20:20:22.216456936 +0200 | |
47 | @@ -41,6 +41,7 @@ | |
48 | ||
49 | #include <misc/sound_util.h> | |
50 | ||
51 | +#define FF_API_OLD_METADATA2 0 | |
52 | #include <libavcodec/avcodec.h> | |
53 | #include <libavformat/avformat.h> | |
54 | ||
55 | @@ -476,17 +477,37 @@ | |
56 | IFusionSoundMusicProvider_FFmpeg_GetTrackDescription( IFusionSoundMusicProvider *thiz, | |
57 | FSTrackDescription *desc ) | |
58 | { | |
59 | + AVDictionaryEntry *tag = NULL; | |
60 | + | |
61 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
62 | - | |
63 | + | |
64 | if (!desc) | |
65 | return DR_INVARG; | |
66 | ||
67 | - direct_snputs( desc->artist, data->ctx->author, FS_TRACK_DESC_ARTIST_LENGTH ); | |
68 | - direct_snputs( desc->title, data->ctx->title, FS_TRACK_DESC_TITLE_LENGTH ); | |
69 | - direct_snputs( desc->album, data->ctx->album, FS_TRACK_DESC_ALBUM_LENGTH ); | |
70 | - direct_snputs( desc->genre, data->ctx->genre, FS_TRACK_DESC_GENRE_LENGTH ); | |
71 | - direct_snputs( desc->encoding, data->codec->codec->name, FS_TRACK_DESC_ENCODING_LENGTH ); | |
72 | - desc->year = data->ctx->year; | |
73 | + tag = av_dict_get(data->ctx->metadata, "artist", NULL, 0); | |
74 | + if (tag) | |
75 | + direct_snputs( desc->artist, tag->value, FS_TRACK_DESC_ARTIST_LENGTH ); | |
76 | + | |
77 | + tag = av_dict_get(data->ctx->metadata, "title", NULL, 0); | |
78 | + if (tag) | |
79 | + direct_snputs( desc->title, tag->value, FS_TRACK_DESC_TITLE_LENGTH ); | |
80 | + | |
81 | + tag = av_dict_get(data->ctx->metadata, "album", NULL, 0); | |
82 | + if (tag) | |
83 | + direct_snputs( desc->album, tag->value, FS_TRACK_DESC_ALBUM_LENGTH ); | |
84 | + | |
85 | + tag = av_dict_get(data->ctx->metadata, "genre", NULL, 0); | |
86 | + if (tag) | |
87 | + direct_snputs( desc->genre, tag->value, FS_TRACK_DESC_GENRE_LENGTH ); | |
88 | + | |
89 | + tag = av_dict_get(data->ctx->metadata, "encoding", NULL, 0); | |
90 | + if (tag) | |
91 | + direct_snputs( desc->encoding, tag->value, FS_TRACK_DESC_ENCODING_LENGTH ); | |
92 | + | |
93 | + tag = av_dict_get(data->ctx->metadata, "year", NULL, 0); | |
94 | + if (tag) | |
95 | + desc->year = atoi(tag->value); | |
96 | + | |
97 | desc->bitrate = data->codec->bit_rate; | |
98 | desc->replaygain = desc->replaygain_album = 0; | |
99 | ||
100 | @@ -595,8 +616,8 @@ | |
101 | } | |
102 | ||
103 | len = AVCODEC_MAX_AUDIO_FRAME_SIZE; | |
104 | - decoded = avcodec_decode_audio2( data->codec, | |
105 | - (s16*)data->buf, &len, pkt_data, pkt_size ); | |
106 | + decoded = avcodec_decode_audio3( data->codec, | |
107 | + (s16*)data->buf, &len, &pkt ); | |
108 | if (decoded < 0) { | |
109 | av_free_packet( &pkt ); | |
110 | pkt_size = 0; | |
111 | @@ -800,8 +821,8 @@ | |
112 | } | |
113 | ||
114 | len = AVCODEC_MAX_AUDIO_FRAME_SIZE; | |
115 | - decoded = avcodec_decode_audio2( data->codec, | |
116 | - (s16*)data->buf, &len, pkt_data, pkt_size ); | |
117 | + decoded = avcodec_decode_audio3( data->codec, | |
118 | + (s16*)data->buf, &len, &pkt ); | |
119 | if (decoded < 0) { | |
120 | av_free_packet( &pkt ); | |
121 | pkt_size = 0; | |
122 | @@ -1208,7 +1229,7 @@ | |
123 | } | |
124 | ||
125 | for (i = 0; i < data->ctx->nb_streams; i++) { | |
126 | - if (data->ctx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) { | |
127 | + if (data->ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { | |
128 | if (!data->st || data->st->codec->bit_rate < data->ctx->streams[i]->codec->bit_rate) | |
129 | data->st = data->ctx->streams[i]; | |
130 | } |