From f36cd6f29cb91cad3f4c3492b6709667e9d9988d Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Mon, 27 Jun 2011 15:50:17 +0000 Subject: [PATCH] - added ffmpeg-0.8 patch (minimal changes to support ffmpeg 0.8) - release 2 Changed files: ffmpegsource-ffmpeg-0.8.patch -> 1.1 ffmpegsource.spec -> 1.3 --- ffmpegsource-ffmpeg-0.8.patch | 104 ++++++++++++++++++++++++++++++++++ ffmpegsource.spec | 12 ++-- 2 files changed, 112 insertions(+), 4 deletions(-) create mode 100644 ffmpegsource-ffmpeg-0.8.patch diff --git a/ffmpegsource-ffmpeg-0.8.patch b/ffmpegsource-ffmpeg-0.8.patch new file mode 100644 index 0000000..ebc6bfb --- /dev/null +++ b/ffmpegsource-ffmpeg-0.8.patch @@ -0,0 +1,104 @@ +--- ffmpegsource-2.15_src/src/core/indexing.cpp.orig 2011-02-10 01:17:44.000000000 +0100 ++++ ffmpegsource-2.15_src/src/core/indexing.cpp 2011-06-27 17:26:09.431750638 +0200 +@@ -27,7 +27,7 @@ + + + extern "C" { +-#include ++#include + #include + } + +@@ -188,9 +188,9 @@ + std::string("Failed to open '") + Filename + "' for hashing"); + + std::vector FileBuffer(1024*1024, 0); +- std::vector ctxmem(av_sha1_size); +- AVSHA1 *ctx = (AVSHA1 *)(&ctxmem[0]); +- av_sha1_init(ctx); ++ std::vector ctxmem(av_sha_size); ++ AVSHA *ctx = (AVSHA *)(&ctxmem[0]); ++ av_sha_init(ctx, 160); + + try { + fread(&FileBuffer[0], 1, FileBuffer.size(), SFile); +@@ -198,7 +198,7 @@ + throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_FILE_READ, + std::string("Failed to read '") + Filename + "' for hashing"); + +- av_sha1_update(ctx, &FileBuffer[0], FileBuffer.size()); ++ av_sha_update(ctx, &FileBuffer[0], FileBuffer.size()); + + fseeko(SFile, -(int)FileBuffer.size(), SEEK_END); + std::fill(FileBuffer.begin(), FileBuffer.end(), 0); +@@ -209,7 +209,7 @@ + throw FFMS_Exception(FFMS_ERROR_PARSER, FFMS_ERROR_FILE_READ, buf.str()); + } + +- av_sha1_update(ctx, &FileBuffer[0], FileBuffer.size()); ++ av_sha_update(ctx, &FileBuffer[0], FileBuffer.size()); + + fseeko(SFile, 0, SEEK_END); + if (ferror(SFile)) +@@ -220,11 +220,11 @@ + } + catch (...) { + fclose(SFile); +- av_sha1_final(ctx, Digest); ++ av_sha_final(ctx, Digest); + throw; + } + fclose(SFile); +- av_sha1_final(ctx, Digest); ++ av_sha_final(ctx, Digest); + } + + void FFMS_Index::Sort() { +--- ffmpegsource-2.15_src/src/core/lavfindexer.cpp.orig 2011-01-21 21:58:09.000000000 +0100 ++++ ffmpegsource-2.15_src/src/core/lavfindexer.cpp 2011-06-27 17:45:31.855122896 +0200 +@@ -20,6 +20,9 @@ + + #include "indexing.h" + ++extern "C" { ++#include ++} + + + FFLAVFIndexer::FFLAVFIndexer(const char *Filename, AVFormatContext *FormatContext) : FFMS_Indexer(Filename) { +@@ -49,7 +52,7 @@ + FormatContext->streams[i]->time_base.den, + static_cast(FormatContext->streams[i]->codec->codec_type))); + +- if (FormatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) { ++ if (FormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { + AVCodec *VideoCodec = avcodec_find_decoder(FormatContext->streams[i]->codec->codec_id); + if (!VideoCodec) + throw FFMS_Exception(FFMS_ERROR_CODEC, FFMS_ERROR_UNSUPPORTED, +@@ -65,7 +68,7 @@ + VideoContexts[i].Parser->flags = PARSER_FLAG_COMPLETE_FRAMES; + IndexMask |= 1 << i; + } +- else if (IndexMask & (1 << i) && FormatContext->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) { ++ else if (IndexMask & (1 << i) && FormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { + AVCodecContext *AudioCodecContext = FormatContext->streams[i]->codec; + + AVCodec *AudioCodec = avcodec_find_decoder(AudioCodecContext->codec_id); +@@ -105,7 +108,7 @@ + bool KeyFrame = !!(Packet.flags & AV_PKT_FLAG_KEY); + ReadTS(Packet, LastValidTS[Track], (*TrackIndices)[Track].UseDTS); + +- if (FormatContext->streams[Track]->codec->codec_type == CODEC_TYPE_VIDEO) { ++ if (FormatContext->streams[Track]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { + if (LastValidTS[Track] == ffms_av_nopts_value) + throw FFMS_Exception(FFMS_ERROR_INDEXING, FFMS_ERROR_PARSER, + "Invalid initial pts and dts"); +@@ -121,7 +124,7 @@ + + (*TrackIndices)[Track].push_back(TFrameInfo::VideoFrameInfo(LastValidTS[Track], RepeatPict, KeyFrame, Packet.pos)); + } +- else if (FormatContext->streams[Track]->codec->codec_type == CODEC_TYPE_AUDIO) { ++ else if (FormatContext->streams[Track]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { + int64_t StartSample = AudioContexts[Track].CurrentSample; + int64_t SampleCount = IndexAudioPacket(Track, &Packet, AudioContexts[Track], *TrackIndices); + diff --git a/ffmpegsource.spec b/ffmpegsource.spec index 2892735..15953d2 100644 --- a/ffmpegsource.spec +++ b/ffmpegsource.spec @@ -2,21 +2,24 @@ Summary: FFmpegSource - FFmpeg wrapper library Summary(pl.UTF-8): FFmpegSource - biblioteka obudowująca FFmpeg Name: ffmpegsource Version: 2.15 -Release: 1 +Release: 2 License: MIT (ffmpegsource itself), GPL v3+ (forced by ffmpeg) Group: Libraries #Source0Download: http://code.google.com/p/ffmpegsource/downloads/list Source0: http://ffmpegsource.googlecode.com/files/%{name}-%{version}_src.7z # Source0-md5: 0d0e2d4f6c4424e5f182f40f451c064e Patch0: %{name}-c++.patch +Patch1: %{name}-ffmpeg-0.8.patch URL: http://code.google.com/p/ffmpegsource/ BuildRequires: autoconf >= 2.58 BuildRequires: automake -BuildRequires: ffmpeg-devel >= 0.5.0 +BuildRequires: ffmpeg-devel >= 0.8.0 BuildRequires: libstdc++-devel BuildRequires: libtool >= 2:2.0 BuildRequires: p7zip BuildRequires: pkgconfig >= 1:0.22 +BuildRequires: rpmbuild(macros) >= 1.566 +BuildRequires: sed >= 4.0 BuildRequires: zlib-devel BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -44,7 +47,7 @@ Summary: Header files for FFmpegSource library Summary(pl.UTF-8): Pliki nagłówkowe biblioteki FFmpegSource Group: Development/Libraries Requires: %{name} = %{version}-%{release} -Requires: ffmpeg-devel >= 0.5.0 +Requires: ffmpeg-devel >= 0.8.0 Requires: libstdc++-devel Requires: zlib-devel @@ -69,8 +72,9 @@ Statyczna biblioteka FFmpegSource. %prep %setup -q -c -T -n %{name}-%{version}_src 7z -o.. x %{SOURCE0} -%undos src/core/utils.cpp +%undos src/core/{indexing,lavfindexer,utils}.cpp %patch0 -p1 +%patch1 -p1 %{__rm} configure %build -- 2.43.0