Magellan Linux

Annotation of /trunk/strigi/patches/strigi-0.7.5-ffmpeg.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1490 - (hide annotations) (download)
Sat Aug 6 17:15:49 2011 UTC (12 years, 10 months ago) by niro
File size: 6965 byte(s)
fixed patch
1 niro 1490 diff -Naur strigi-0.7.5/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp strigi-0.7.5-magellan/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp
2     --- strigi-0.7.5/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp 2011-06-02 11:29:26.000000000 +0200
3     +++ strigi-0.7.5-magellan/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp 2011-08-06 20:49:37.000000000 +0200
4     @@ -348,7 +348,7 @@
5 niro 1489 if ((size = in->size()) >= 0)
6     ar.addValue(factory->durationProperty, (uint32_t)(size/(fc->bit_rate/8)));
7     }
8     - if(fc->nb_streams==1 && fc->streams[0]->codec->codec_type == CODEC_TYPE_AUDIO) {
9     + if(fc->nb_streams==1 && fc->streams[0]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
10     ar.addValue(factory->typeProperty, NFO "Audio");
11     ar.addValue(factory->typeProperty, NMM_DRAFT "MusicPiece");
12     } else {
13 niro 1490 @@ -359,7 +359,7 @@
14 niro 1489 const AVStream &stream = *fc->streams[i];
15     const AVCodecContext &codec = *stream.codec;
16    
17     - if (codec.codec_type == CODEC_TYPE_AUDIO || codec.codec_type == CODEC_TYPE_VIDEO) {
18     + if (codec.codec_type == AVMEDIA_TYPE_AUDIO || codec.codec_type == AVMEDIA_TYPE_VIDEO) {
19     const string streamuri = ar.newAnonymousUri();
20     ar.addValue(factory->hasPartProperty, streamuri);
21     ar.addTriplet(streamuri, partOfPropertyName, ar.path());
22 niro 1490 @@ -370,8 +370,16 @@
23 niro 1489 outs << (stream.duration * stream.time_base.num / stream.time_base.den);
24     ar.addTriplet(streamuri, durationPropertyName,outs.str());
25     }
26     - if (size_t len = strlen(stream.language)) {
27     - ar.addTriplet(streamuri, languagePropertyName, string(stream.language, len));
28     +#if FF_API_OLD_METADATA2
29     + AVMetadataTag *entry = av_metadata_get(stream.metadata, "language", NULL, 0);
30     +#else
31     + AVDictionaryEntry *entry = av_dict_get(stream.metadata, "language", NULL, 0);
32     +#endif
33     + if (entry != NULL) {
34     + const char *languageValue = entry->value;
35     + if (size_t len = strlen(languageValue)) {
36     + ar.addTriplet(streamuri, languagePropertyName, string(languageValue, len));
37     + }
38     }
39     const AVCodec *p = avcodec_find_decoder(codec.codec_id);
40     if (p) {
41 niro 1490 @@ -408,7 +416,7 @@
42 niro 1489 ar.addTriplet(streamuri, bitratePropertyName, outs.str());
43     }
44    
45     - if (codec.codec_type == CODEC_TYPE_AUDIO) {
46     + if (codec.codec_type == AVMEDIA_TYPE_AUDIO) {
47    
48     ar.addTriplet(streamuri, typePropertyName, audioClassName);
49     if (codec.channels) {
50 niro 1490 @@ -458,36 +466,107 @@
51 niro 1489 }
52    
53     // Tags
54     -
55     - if (int32_t len = strlen(fc->title)) {
56     - ar.addValue(factory->titleProperty, string(fc->title, len) );
57     - }
58     - if (int32_t len = strlen(fc->author)) {
59     - const string creatoruri = ar.newAnonymousUri();
60     - ar.addValue(factory->creatorProperty, creatoruri);
61     - ar.addTriplet(creatoruri, typePropertyName, contactClassName);
62     - ar.addTriplet(creatoruri, fullnamePropertyName, string(fc->author, len) );
63     - }
64     - if (int32_t len = strlen(fc->copyright)) {
65     - ar.addValue(factory->copyrightProperty, string(fc->copyright, len) );
66     - }
67     - if (int32_t len = strlen(fc->comment)) {
68     - ar.addValue(factory->commentProperty, string(fc->comment, len) );
69     - }
70     - if (int32_t len = strlen(fc->album)) {
71     - const string album = ar.newAnonymousUri();
72     - ar.addValue(factory->albumProperty, album);
73     +#if FF_API_OLD_METADATA2
74     + AVMetadataTag *entry = av_metadata_get(fc->metadata, "title", NULL, 0);
75     +#else
76     + AVDictionaryEntry *entry = av_dict_get(fc->metadata, "title", NULL, 0);
77     +#endif
78     + if (entry != NULL)
79     + {
80     + const char *titleValue = entry->value;
81     + if (int32_t len = strlen(titleValue)) {
82     + ar.addValue(factory->titleProperty, string(titleValue, len) );
83     + }
84     + }
85     +#if FF_API_OLD_METADATA2
86     + entry = av_metadata_get(fc->metadata, "author", NULL, 0);
87     +#else
88     + entry = av_dict_get(fc->metadata, "author", NULL, 0);
89     +#endif
90     + if (entry != NULL)
91     + {
92     + const char *authorValue = entry->value;
93     + if (int32_t len = strlen(authorValue)) {
94     + const string creatoruri = ar.newAnonymousUri();
95     + ar.addValue(factory->creatorProperty, creatoruri);
96     + ar.addTriplet(creatoruri, typePropertyName, contactClassName);
97     + ar.addTriplet(creatoruri, fullnamePropertyName, string(authorValue, len) );
98     + }
99     + }
100     +#if FF_API_OLD_METADATA2
101     + entry = av_metadata_get(fc->metadata, "copyright", NULL, 0);
102     +#else
103     + entry = av_dict_get(fc->metadata, "copyright", NULL, 0);
104     +#endif
105     + if (entry != NULL)
106     + {
107     + const char *copyrightValue = entry->value;
108     + if (int32_t len = strlen(copyrightValue)) {
109     + ar.addValue(factory->copyrightProperty, string(copyrightValue, len) );
110     + }
111     + }
112     +#if FF_API_OLD_METADATA2
113     + entry = av_metadata_get(fc->metadata, "comment", NULL, 0);
114     +#else
115     + entry = av_dict_get(fc->metadata, "comment", NULL, 0);
116     +#endif
117     + if (entry != NULL)
118     + {
119     + const char *commentValue = entry->value;
120     + if (int32_t len = strlen(commentValue)) {
121     + ar.addValue(factory->commentProperty, string(commentValue, len) );
122     + }
123     + }
124     +#if FF_API_OLD_METADATA2
125     + entry = av_metadata_get(fc->metadata, "album", NULL, 0);
126     +#else
127     + entry = av_dict_get(fc->metadata, "album", NULL, 0);
128     +#endif
129     + if (entry != NULL)
130     + {
131     + const char *albumValue = entry->value;
132     + if (int32_t len = strlen(albumValue)) {
133     + const string album = ar.newAnonymousUri();
134     + ar.addValue(factory->albumProperty, album);
135     ar.addTriplet(album, typePropertyName, albumClassName);
136     - ar.addTriplet(album, titlePropertyName, string(fc->album, len) );
137     + ar.addTriplet(album, titlePropertyName, string(albumValue, len) );
138     + }
139     }
140     - if (int32_t len = strlen(fc->genre)) {
141     - ar.addValue(factory->genreProperty, string(fc->genre, len) );
142     +#if FF_API_OLD_METADATA2
143     + entry = av_metadata_get(fc->metadata, "genre", NULL, 0);
144     +#else
145     + entry = av_dict_get(fc->metadata, "genre", NULL, 0);
146     +#endif
147     + if (entry != NULL)
148     + {
149     + const char *genreValue = entry->value;
150     + if (int32_t len = strlen(genreValue)) {
151     + ar.addValue(factory->genreProperty, string(genreValue, len) );
152     + }
153     }
154     - if (fc->track) {
155     - ar.addValue(factory->trackProperty, fc->track);
156     +#if FF_API_OLD_METADATA2
157     + entry = av_metadata_get(fc->metadata, "track", NULL, 0);
158     +#else
159     + entry = av_dict_get(fc->metadata, "track", NULL, 0);
160     +#endif
161     + if (entry != NULL)
162     + {
163     + const char *trackValue = entry->value;
164     + if (int32_t len = strlen(trackValue)) {
165     + ar.addValue(factory->trackProperty, string(trackValue, len) );
166     + }
167     }
168     - if (fc->year) {
169     - ar.addValue(factory->createdProperty, fc->year);
170     +#if FF_API_OLD_METADATA2
171     + entry = av_metadata_get(fc->metadata, "year", NULL, 0);
172     +#else
173     + entry = av_dict_get(fc->metadata, "year", NULL, 0);
174     +#endif
175     + if (entry != NULL)
176     + {
177     + const char *yearValue = entry->value;
178     + if (int32_t len = strlen(yearValue)) {
179     + ar.addValue(factory->createdProperty, string(yearValue, len) );
180     + }
181     }
182    
183     av_close_input_stream(fc);