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
7 -#include <libavutil/sha1.h>
8 +#include <libavutil/sha.h>
13 std::string("Failed to open '") + Filename + "' for hashing");
15 std::vector<uint8_t> FileBuffer(1024*1024, 0);
16 - std::vector<uint8_t> ctxmem(av_sha1_size);
17 - AVSHA1 *ctx = (AVSHA1 *)(&ctxmem[0]);
19 + std::vector<uint8_t> ctxmem(av_sha_size);
20 + AVSHA *ctx = (AVSHA *)(&ctxmem[0]);
21 + av_sha_init(ctx, 160);
24 fread(&FileBuffer[0], 1, FileBuffer.size(), SFile);
26 throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_FILE_READ,
27 std::string("Failed to read '") + Filename + "' for hashing");
29 - av_sha1_update(ctx, &FileBuffer[0], FileBuffer.size());
30 + av_sha_update(ctx, &FileBuffer[0], FileBuffer.size());
32 fseeko(SFile, -(int)FileBuffer.size(), SEEK_END);
33 std::fill(FileBuffer.begin(), FileBuffer.end(), 0);
35 throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_FILE_READ, buf.str());
38 - av_sha1_update(ctx, &FileBuffer[0], FileBuffer.size());
39 + av_sha_update(ctx, &FileBuffer[0], FileBuffer.size());
41 fseeko(SFile, 0, SEEK_END);
47 - av_sha1_final(ctx, Digest);
48 + av_sha_final(ctx, Digest);
52 - av_sha1_final(ctx, Digest);
53 + av_sha_final(ctx, Digest);
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
64 +#include <libavutil/avutil.h>
68 FFLAVFIndexer::FFLAVFIndexer(const char *Filename, AVFormatContext *FormatContext) : FFMS_Indexer(Filename) {
70 FormatContext->streams[i]->time_base.den,
71 static_cast<FFMS_TrackType>(FormatContext->streams[i]->codec->codec_type)));
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);
77 throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_UNSUPPORTED,
79 VideoContexts[i].Parser->flags = PARSER_FLAG_COMPLETE_FRAMES;
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;
86 AVCodec *AudioCodec = avcodec_find_decoder(AudioCodecContext->codec_id);
88 bool KeyFrame = !!(Packet.flags & AV_PKT_FLAG_KEY);
89 ReadTS(Packet, LastValidTS[Track], (*TrackIndices)[Track].UseDTS);
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");
98 (*TrackIndices)[Track].push_back(TFrameInfo::VideoFrameInfo(LastValidTS[Track], RepeatPict, KeyFrame, Packet.pos));
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);