]> git.pld-linux.org Git - packages/ffms2.git/blob - ffmpegsource-ffmpeg-0.8.patch
- added ffmpeg-0.8 patch (minimal changes to support ffmpeg 0.8)
[packages/ffms2.git] / ffmpegsource-ffmpeg-0.8.patch
1 --- ffmpegsource-2.15_src/src/core/indexing.cpp.orig    2011-02-10 01:17:44.000000000 +0100
2 +++ ffmpegsource-2.15_src/src/core/indexing.cpp 2011-06-27 17:26:09.431750638 +0200
3 @@ -27,7 +27,7 @@
4  
5  
6  extern "C" {
7 -#include <libavutil/sha1.h>
8 +#include <libavutil/sha.h>
9  #include <zlib.h>
10  }
11  
12 @@ -188,9 +188,9 @@
13                         std::string("Failed to open '") + Filename + "' for hashing");
14  
15         std::vector<uint8_t> FileBuffer(1024*1024, 0);
16 -       std::vector<uint8_t> ctxmem(av_sha1_size);
17 -       AVSHA1 *ctx = (AVSHA1 *)(&ctxmem[0]);
18 -       av_sha1_init(ctx);
19 +       std::vector<uint8_t> ctxmem(av_sha_size);
20 +       AVSHA *ctx = (AVSHA *)(&ctxmem[0]);
21 +       av_sha_init(ctx, 160);
22  
23         try {
24                 fread(&FileBuffer[0], 1, FileBuffer.size(), SFile);
25 @@ -198,7 +198,7 @@
26                         throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_FILE_READ,
27                                 std::string("Failed to read '") + Filename + "' for hashing");
28  
29 -               av_sha1_update(ctx, &FileBuffer[0], FileBuffer.size());
30 +               av_sha_update(ctx, &FileBuffer[0], FileBuffer.size());
31  
32                 fseeko(SFile, -(int)FileBuffer.size(), SEEK_END);
33                 std::fill(FileBuffer.begin(), FileBuffer.end(), 0);
34 @@ -209,7 +209,7 @@
35                         throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_FILE_READ, buf.str());
36                 }
37  
38 -               av_sha1_update(ctx, &FileBuffer[0], FileBuffer.size());
39 +               av_sha_update(ctx, &FileBuffer[0], FileBuffer.size());
40  
41                 fseeko(SFile, 0, SEEK_END);
42                 if (ferror(SFile))
43 @@ -220,11 +220,11 @@
44         }
45         catch (...) {
46                 fclose(SFile);
47 -               av_sha1_final(ctx, Digest);
48 +               av_sha_final(ctx, Digest);
49                 throw;
50         }
51         fclose(SFile);
52 -       av_sha1_final(ctx, Digest);
53 +       av_sha_final(ctx, Digest);
54  }
55  
56  void FFMS_Index::Sort() {
57 --- ffmpegsource-2.15_src/src/core/lavfindexer.cpp.orig 2011-01-21 21:58:09.000000000 +0100
58 +++ ffmpegsource-2.15_src/src/core/lavfindexer.cpp      2011-06-27 17:45:31.855122896 +0200
59 @@ -20,6 +20,9 @@
60  
61  #include "indexing.h"
62  
63 +extern "C" {
64 +#include <libavutil/avutil.h>
65 +}
66  
67  
68  FFLAVFIndexer::FFLAVFIndexer(const char *Filename, AVFormatContext *FormatContext) : FFMS_Indexer(Filename) {
69 @@ -49,7 +52,7 @@
70                         FormatContext->streams[i]->time_base.den,
71                         static_cast<FFMS_TrackType>(FormatContext->streams[i]->codec->codec_type)));
72  
73 -               if (FormatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) {
74 +               if (FormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
75                         AVCodec *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codec->codec_id);
76                         if (!VideoCodec)
77                                 throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_UNSUPPORTED,
78 @@ -65,7 +68,7 @@
79                                 VideoContexts[i].Parser->flags = PARSER_FLAG_COMPLETE_FRAMES;
80                         IndexMask |= 1 << i;
81                 }
82 -               else if (IndexMask & (1 << i) && FormatContext->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) {
83 +               else if (IndexMask & (1 << i) && FormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
84                         AVCodecContext *AudioCodecContext = FormatContext->streams[i]->codec;
85  
86                         AVCodec *AudioCodec = avcodec_find_decoder(AudioCodecContext->codec_id);
87 @@ -105,7 +108,7 @@
88                 bool KeyFrame = !!(Packet.flags & AV_PKT_FLAG_KEY);
89                 ReadTS(Packet, LastValidTS[Track], (*TrackIndices)[Track].UseDTS);
90  
91 -               if (FormatContext->streams[Track]->codec->codec_type == CODEC_TYPE_VIDEO) {
92 +               if (FormatContext->streams[Track]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
93                         if (LastValidTS[Track] == ffms_av_nopts_value)
94                                 throw FFMS_Exception(FFMS_ERROR_INDEXING, FFMS_ERROR_PARSER,
95                                 "Invalid initial pts and dts");
96 @@ -121,7 +124,7 @@
97  
98                         (*TrackIndices)[Track].push_back(TFrameInfo::VideoFrameInfo(LastValidTS[Track], RepeatPict, KeyFrame, Packet.pos));
99                 }
100 -               else if (FormatContext->streams[Track]->codec->codec_type == CODEC_TYPE_AUDIO) {
101 +               else if (FormatContext->streams[Track]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
102                         int64_t StartSample = AudioContexts[Track].CurrentSample;
103                         int64_t SampleCount = IndexAudioPacket(Track, &Packet, AudioContexts[Track], *TrackIndices);
104  
This page took 0.084149 seconds and 3 git commands to generate.