1 |
johu 12/07/04 12:07:44 |
2 |
|
3 |
Added: strigi-0.7.7-ffmpeg-0.11.patch |
4 |
Log: |
5 |
Add mandriva patch to build with ffmpeg-0.11 spotted by Hanno Boeck <hanno@g.o> wrt bug #417877. |
6 |
|
7 |
(Portage version: 2.2.0_alpha115/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-misc/strigi/files/strigi-0.7.7-ffmpeg-0.11.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/strigi/files/strigi-0.7.7-ffmpeg-0.11.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/strigi/files/strigi-0.7.7-ffmpeg-0.11.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: strigi-0.7.7-ffmpeg-0.11.patch |
16 |
=================================================================== |
17 |
Source: Mandriva patch |
18 |
Upstream: No bug report on bugs.kde.org |
19 |
Reason: libstreamanalyzer uses deprecated symbols from ffmpeg removed in 0.11 |
20 |
--- strigi-0.7.7/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp.bero 2012-06-08 16:49:40.846877030 +0200 |
21 |
+++ strigi-0.7.7/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp 2012-06-08 17:27:40.416888115 +0200 |
22 |
@@ -305,13 +305,6 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
23 |
uint8_t pDataBuffer[32768];//65536]; |
24 |
long lSize = 32768; |
25 |
|
26 |
- ByteIOContext ByteIOCtx; |
27 |
- if(init_put_byte(&ByteIOCtx, pDataBuffer, lSize, 0, in, read_data, NULL, seek_data) < 0) |
28 |
- return -1; |
29 |
- |
30 |
- //pAVInputFormat->flags |= AVFMT_NOFILE; |
31 |
- ByteIOCtx.is_streamed = 0; |
32 |
- |
33 |
AVProbeData pd; |
34 |
const char *buf; |
35 |
pd.filename =""; |
36 |
@@ -324,14 +317,27 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
37 |
if(fmt == NULL) |
38 |
return 1; |
39 |
|
40 |
- AVFormatContext *fc = NULL; |
41 |
- if(av_open_input_stream(&fc, &ByteIOCtx, "", fmt, NULL) < 0) |
42 |
+ AVFormatContext *fc = avformat_alloc_context(); |
43 |
+ if(!fc) |
44 |
+ return -1; |
45 |
+ |
46 |
+ AVIOContext *pb = avio_alloc_context(pDataBuffer, lSize, 0, in, read_data, NULL, seek_data); |
47 |
+ if(!fc->pb) { |
48 |
+ av_free(fc); |
49 |
return -1; |
50 |
+ } |
51 |
+ |
52 |
+ fc->pb = pb; |
53 |
+ |
54 |
+ if(avformat_open_input(&fc, "", fmt, NULL) < 0) { |
55 |
+ av_free(fc); |
56 |
+ return -1; |
57 |
+ } |
58 |
|
59 |
- av_find_stream_info(fc); |
60 |
+ avformat_find_stream_info(fc, NULL); |
61 |
|
62 |
// Dump information about file onto standard error |
63 |
- dump_format(fc, 0, ar.path().c_str(), false); |
64 |
+ av_dump_format(fc, 0, ar.path().c_str(), false); |
65 |
|
66 |
if(fc->bit_rate) |
67 |
ar.addValue(factory->bitrateProperty, fc->bit_rate); |
68 |
@@ -372,10 +378,10 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
69 |
ar.addTriplet(streamuri, durationPropertyName,outs.str()); |
70 |
} |
71 |
|
72 |
- //FIXME we must stop using the deprecated fuction av_metadata_get and use |
73 |
+ //FIXME we must stop using the deprecated fuction av_dict_get and use |
74 |
// av_dict_get once we are able to detect the version of FFMpeg being used |
75 |
// using version macros. same goes for all occurences of this function. |
76 |
- AVMetadataTag *entry = av_metadata_get(stream.metadata, "language", NULL, 0); |
77 |
+ AVDictionaryEntry *entry = av_dict_get(stream.metadata, "language", NULL, 0); |
78 |
if (entry != NULL) { |
79 |
const char *languageValue = entry->value; |
80 |
if (size_t len = strlen(languageValue)) { |
81 |
@@ -430,7 +436,7 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
82 |
outs << codec.sample_rate; |
83 |
ar.addTriplet(streamuri, sampleratePropertyName, outs.str()); |
84 |
} |
85 |
- if (codec.sample_fmt != SAMPLE_FMT_NONE) {}//FIXME sample format |
86 |
+ if (codec.sample_fmt != AV_SAMPLE_FMT_NONE) {}//FIXME sample format |
87 |
|
88 |
} else { // video stream |
89 |
|
90 |
@@ -469,7 +475,7 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
91 |
|
92 |
// Tags |
93 |
|
94 |
- AVMetadataTag *entry = av_metadata_get(fc->metadata, "title", NULL, 0); |
95 |
+ AVDictionaryEntry *entry = av_dict_get(fc->metadata, "title", NULL, 0); |
96 |
if (entry != NULL) |
97 |
{ |
98 |
const char *titleValue = entry->value; |
99 |
@@ -478,7 +484,7 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
100 |
} |
101 |
} |
102 |
|
103 |
- entry = av_metadata_get(fc->metadata, "author", NULL, 0); |
104 |
+ entry = av_dict_get(fc->metadata, "author", NULL, 0); |
105 |
if (entry != NULL) |
106 |
{ |
107 |
const char *authorValue = entry->value; |
108 |
@@ -490,7 +496,7 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
109 |
} |
110 |
} |
111 |
|
112 |
- entry = av_metadata_get(fc->metadata, "copyright", NULL, 0); |
113 |
+ entry = av_dict_get(fc->metadata, "copyright", NULL, 0); |
114 |
if (entry != NULL) |
115 |
{ |
116 |
const char *copyrightValue = entry->value; |
117 |
@@ -499,7 +505,7 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
118 |
} |
119 |
} |
120 |
|
121 |
- entry = av_metadata_get(fc->metadata, "comment", NULL, 0); |
122 |
+ entry = av_dict_get(fc->metadata, "comment", NULL, 0); |
123 |
if (entry != NULL) |
124 |
{ |
125 |
const char *commentValue = entry->value; |
126 |
@@ -508,7 +514,7 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
127 |
} |
128 |
} |
129 |
|
130 |
- entry = av_metadata_get(fc->metadata, "album", NULL, 0); |
131 |
+ entry = av_dict_get(fc->metadata, "album", NULL, 0); |
132 |
if (entry != NULL) |
133 |
{ |
134 |
const char *albumValue = entry->value; |
135 |
@@ -520,7 +526,7 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
136 |
} |
137 |
} |
138 |
|
139 |
- entry = av_metadata_get(fc->metadata, "genre", NULL, 0); |
140 |
+ entry = av_dict_get(fc->metadata, "genre", NULL, 0); |
141 |
if (entry != NULL) |
142 |
{ |
143 |
const char *genreValue = entry->value; |
144 |
@@ -529,7 +535,7 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
145 |
} |
146 |
} |
147 |
|
148 |
- entry = av_metadata_get(fc->metadata, "track", NULL, 0); |
149 |
+ entry = av_dict_get(fc->metadata, "track", NULL, 0); |
150 |
if (entry != NULL) |
151 |
{ |
152 |
const char *trackValue = entry->value; |
153 |
@@ -538,7 +544,7 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
154 |
} |
155 |
} |
156 |
|
157 |
- entry = av_metadata_get(fc->metadata, "year", NULL, 0); |
158 |
+ entry = av_dict_get(fc->metadata, "year", NULL, 0); |
159 |
if (entry != NULL) |
160 |
{ |
161 |
const char *yearValue = entry->value; |
162 |
@@ -547,7 +553,8 @@ FFMPEGEndAnalyzer::analyze(AnalysisResul |
163 |
} |
164 |
} |
165 |
|
166 |
- av_close_input_stream(fc); |
167 |
+ avformat_close_input(&fc); |
168 |
+ av_free(pb); |
169 |
//url_fclose(&ByteIOCtx); |
170 |
|
171 |
return 0; |