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