summaryrefslogtreecommitdiffstats
path: root/plugins/decoder
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2014-06-05 12:23:38 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2014-06-05 12:23:38 +0900
commita6902f81bb511d413ad161531c2fd55a09e70cec (patch)
tree8c60f74bd411b0bbb211449b19b9f308777097cd /plugins/decoder
parent789ece7a1d553f5b2a1555b8c89a5056600d5f9c (diff)
downloadk3b-a6902f81bb511d413ad161531c2fd55a09e70cec.tar.gz
k3b-a6902f81bb511d413ad161531c2fd55a09e70cec.zip
Fixed FTBFS caused by migration to libav10 (Debian/Jessie). This resolves bug 2064.
Diffstat (limited to 'plugins/decoder')
-rw-r--r--plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
index 348d32a..826643b 100644
--- a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+++ b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
@@ -37,6 +37,21 @@ extern "C" {
#define AVMEDIA_TYPE_SUBTITLE CODEC_TYPE_SUBTITLE
#endif
+// From libavcodec version 54.25, CodecID have been renamed to AVCodecID and all CODEC_ID_* to AV_CODEC_ID_*.
+// This code can be simplyfied once all supported distros have updated to libavcodec version >=54.25
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 25, 0)
+#define K3B_CODEC_ID_WMAV1 CODEC_ID_WMAV1
+#define K3B_CODEC_ID_WMAV2 CODEC_ID_WMAV2
+#define K3B_CODEC_ID_MP3 CODEC_ID_MP3
+#define K3B_CODEC_ID_AAC CODEC_ID_AAC
+#else
+#define K3B_CODEC_ID_WMAV1 AV_CODEC_ID_WMAV1
+#define K3B_CODEC_ID_WMAV2 AV_CODEC_ID_WMAV2
+#define K3B_CODEC_ID_MP3 AV_CODEC_ID_MP3
+#define K3B_CODEC_ID_AAC AV_CODEC_ID_AAC
+#endif
+
+
K3bFFMpegWrapper* K3bFFMpegWrapper::s_instance = 0;
@@ -217,13 +232,13 @@ int K3bFFMpegFile::type() const
TQString K3bFFMpegFile::typeComment() const
{
switch( type() ) {
- case CODEC_ID_WMAV1:
+ case K3B_CODEC_ID_WMAV1:
return i18n("Windows Media v1");
- case CODEC_ID_WMAV2:
+ case K3B_CODEC_ID_WMAV2:
return i18n("Windows Media v2");
- case CODEC_ID_MP3:
+ case K3B_CODEC_ID_MP3:
return i18n("MPEG 1 Layer III");
- case CODEC_ID_AAC:
+ case K3B_CODEC_ID_AAC:
return i18n("Advanced Audio Coding (AAC)");
default:
return TQString::fromLocal8Bit( d->codec->name );
@@ -424,9 +439,9 @@ K3bFFMpegFile* K3bFFMpegWrapper::open( const TQString& filename ) const
// mp3 being one of them sadly. Most importantly: allow the libsndfile decoder to do
// its thing.
//
- if( file->type() == CODEC_ID_WMAV1 ||
- file->type() == CODEC_ID_WMAV2 ||
- file->type() == CODEC_ID_AAC )
+ if( file->type() == K3B_CODEC_ID_WMAV1 ||
+ file->type() == K3B_CODEC_ID_WMAV2 ||
+ file->type() == K3B_CODEC_ID_AAC )
#endif
return file;
}