multimedia/mediatomb: Fixed build with new ffmpeg

Signed-off-by: Heinz Wiesinger <pprkut@slackbuilds.org>
This commit is contained in:
Heinz Wiesinger 2012-08-19 20:12:02 +02:00
parent fe986531ef
commit 18525f3f57
5 changed files with 190 additions and 3 deletions

View file

@ -0,0 +1,52 @@
--- mediatomb-0.12.1.orig/src/metadata/ffmpeg_handler.cc 2012-06-18 02:50:35.000000000 -0400
+++ mediatomb-0.12.1/src/metadata/ffmpeg_handler.cc 2012-06-18 02:59:02.000000000 -0400
@@ -107,8 +107,8 @@
return;
for (const mapping_t *m = mapping; m->avname != NULL; m++)
{
- AVMetadataTag *tag = NULL;
- tag = av_metadata_get(pFormatCtx->metadata, m->avname, NULL, 0);
+ AVDictionaryEntry *tag = NULL;
+ tag = av_dict_get(pFormatCtx->metadata, m->avname, NULL, 0);
if (tag && tag->value && tag->value[0])
{
log_debug("Added metadata %s: %s\n", m->avname, tag->value);
@@ -278,7 +278,7 @@
int x = 0;
int y = 0;
- AVFormatContext *pFormatCtx;
+ AVFormatContext *pFormatCtx = avformat_alloc_context();
// Suppress all log messages
av_log_set_callback(FfmpegNoOutputStub);
@@ -286,15 +286,15 @@
// Register all formats and codecs
av_register_all();
- // Open video file
- if (av_open_input_file(&pFormatCtx,
- item->getLocation().c_str(), NULL, 0, NULL) != 0)
+ // Open video file
+ if (avformat_open_input(&pFormatCtx,
+ item->getLocation().c_str(), NULL, NULL) != 0)
return; // Couldn't open file
// Retrieve stream information
- if (av_find_stream_info(pFormatCtx) < 0)
+ if (avformat_find_stream_info(pFormatCtx,NULL) < 0)
{
- av_close_input_file(pFormatCtx);
+ avformat_close_input(&pFormatCtx);
return; // Couldn't find stream information
}
// Add metadata using ffmpeg library calls
@@ -303,7 +303,7 @@
addFfmpegResourceFields(item, pFormatCtx, &x, &y);
// Close the video file
- av_close_input_file(pFormatCtx);
+ avformat_close_input(&pFormatCtx);
}
Ref<IOHandler> FfmpegHandler::serveContent(Ref<CdsItem> item, int resNum, off_t *data_size)

View file

@ -0,0 +1,10 @@
--- a/src/zmm/object.h
+++ b/src/zmm/object.h
@@ -33,6 +33,7 @@
#define __ZMM_OBJECT_H__
#include <new> // for size_t
+#include <cstddef>
#include "atomic.h"
namespace zmm

View file

@ -0,0 +1,120 @@
diff --git a/src/hash/dbo_hash.h b/src/hash/dbo_hash.h
index 2e58627..16c15b3 100644
--- a/src/hash/dbo_hash.h
+++ b/src/hash/dbo_hash.h
@@ -106,7 +106,7 @@ public:
inline bool remove(KT key)
{
struct dbo_hash_slot<KT, VT> *slot;
- if (! search(key, &slot))
+ if (! this->search(key, &slot))
return false;
slot->key = deletedKey;
slot->value->release();
@@ -136,7 +136,7 @@ public:
inline void put(KT key, zmm::Ref<VT> value)
{
struct dbo_hash_slot<KT, VT> *slot;
- search(key, &slot);
+ this->search(key, &slot);
put(key, (hash_slot_t)slot, value);
}
void put(KT key, hash_slot_t destSlot, zmm::Ref<VT> value)
@@ -162,7 +162,7 @@ public:
inline zmm::Ref<VT> get(KT key)
{
struct dbo_hash_slot<KT, VT> *slot;
- bool found = search(key, &slot);
+ bool found = this->search(key, &slot);
if (found)
return zmm::Ref<VT>(slot->value);
else
@@ -174,7 +174,7 @@ public:
inline zmm::Ref<VT> get(KT key, hash_slot_t *destSlot)
{
struct dbo_hash_slot<KT, VT> **slot = (struct dbo_hash_slot<KT, VT> **)destSlot;
- bool found = search(key, slot);
+ bool found = this->search(key, slot);
if (found)
return zmm::Ref<VT>((*slot)->value);
else
diff --git a/src/hash/dbr_hash.h b/src/hash/dbr_hash.h
index 6e65d7f..7028890 100644
--- a/src/hash/dbr_hash.h
+++ b/src/hash/dbr_hash.h
@@ -124,7 +124,7 @@ public:
inline bool remove(KT key)
{
struct dbr_hash_slot<KT> *slot;
- if (! search(key, &slot))
+ if (! this->search(key, &slot))
return false;
slot->key = deletedKey;
int array_slot = slot->array_slot;
@@ -134,7 +134,7 @@ public:
return true;
}
data_array[array_slot] = data_array[--this->count];
- if (! search(data_array[array_slot], &slot))
+ if (! this->search(data_array[array_slot], &slot))
{
log_debug("DBR-Hash-Error: (%d; array_slot=%d; count=%d)\n", data_array[array_slot], array_slot, this->count);
throw zmm::Exception(_("DBR-Hash-Error: key in data_array not found in hashtable"));
@@ -146,7 +146,7 @@ public:
inline void put(KT key)
{
struct dbr_hash_slot<KT> *slot;
- if (! search(key, &slot))
+ if (! this->search(key, &slot))
{
#ifdef TOMBDEBUG
if (this->count >= realCapacity)
@@ -194,7 +194,7 @@ public:
inline bool exists(KT key)
{
struct dbr_hash_slot<KT> *slot;
- return search(key, &slot);
+ return this->search(key, &slot);
}
/*
diff --git a/src/hash/dso_hash.h b/src/hash/dso_hash.h
index adfb97f..03ec852 100644
--- a/src/hash/dso_hash.h
+++ b/src/hash/dso_hash.h
@@ -100,7 +100,7 @@ public:
inline bool remove(zmm::String key)
{
struct dso_hash_slot<VT> *slot;
- if (! search(key, &slot))
+ if (! this->search(key, &slot))
return false;
slot->key->release();
slot->value->release();
@@ -112,7 +112,7 @@ public:
inline void put(zmm::String key, zmm::Ref<VT> value)
{
struct dso_hash_slot<VT> *slot;
- search(key, &slot);
+ this->search(key, &slot);
put(key, (hash_slot_t)slot, value);
}
void put(zmm::String key, hash_slot_t destSlot, zmm::Ref<VT> value)
@@ -141,7 +141,7 @@ public:
inline zmm::Ref<VT> get(zmm::String key)
{
struct dso_hash_slot<VT> *slot;
- bool found = search(key, &slot);
+ bool found = this->search(key, &slot);
if (found)
return zmm::Ref<VT>(slot->value);
else
@@ -153,7 +153,7 @@ public:
inline zmm::Ref<VT> get(zmm::String key, hash_slot_t *destSlot)
{
struct dso_hash_slot<VT> **slot = (struct dso_hash_slot<VT> **)destSlot;
- bool found = search(key, slot);
+ bool found = this->search(key, slot);
if (found)
return zmm::Ref<VT>((*slot)->value);
else

View file

@ -2,7 +2,7 @@
# Slackware build script for mediatomb # Slackware build script for mediatomb
# Copyright 2010 Heinz Wiesinger, Amsterdam, The Netherlands # Copyright 2010-2012 Heinz Wiesinger, Amsterdam, The Netherlands
# All rights reserved. # All rights reserved.
# #
# Redistribution and use of this script, with or without modification, is # Redistribution and use of this script, with or without modification, is
@ -24,7 +24,7 @@
PRGNAM=mediatomb PRGNAM=mediatomb
VERSION=0.12.1 VERSION=0.12.1
BUILD=${BUILD:-2} BUILD=${BUILD:-3}
TAG=${TAG:-_SBo} TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then if [ -z "$ARCH" ]; then
@ -79,6 +79,11 @@ chmod -R u+w,go+r-w,a-s .
# Fix building with newer ffmpeg releases # Fix building with newer ffmpeg releases
patch -p1 -i $CWD/libav_0.7_support.patch patch -p1 -i $CWD/libav_0.7_support.patch
patch -p1 -i $CWD/libavformat.patch
# Fix compiling with gcc 4.7
patch -p1 -i $CWD/mediatomb-0.12.1-gcc46.patch
patch -p1 -i $CWD/mediatomb-0.12.1-gcc47.patch
# We need LDFLAGS="-ldl" for proper sqlite detection # We need LDFLAGS="-ldl" for proper sqlite detection
CFLAGS="$SLKCFLAGS" \ CFLAGS="$SLKCFLAGS" \

View file

@ -5,6 +5,6 @@ DOWNLOAD="http://downloads.sourceforge.net/mediatomb/mediatomb-0.12.1.tar.gz"
MD5SUM="e927dd5dc52d3cfcebd8ca1af6f0d3c2" MD5SUM="e927dd5dc52d3cfcebd8ca1af6f0d3c2"
DOWNLOAD_x86_64="" DOWNLOAD_x86_64=""
MD5SUM_x86_64="" MD5SUM_x86_64=""
REQUIRES="ffmpeg ffmpegthumbnailer lastfmlib libmp4v2" REQUIRES=""
MAINTAINER="Heinz Wiesinger" MAINTAINER="Heinz Wiesinger"
EMAIL="pprkut@liwjatan.at" EMAIL="pprkut@liwjatan.at"