Commit acc3a0ed authored by Richard Lärkäng's avatar Richard Lärkäng
Browse files

Fix Ogg/Vorbis support because HAVE_VORBIS is no longer set to 2

(since as far as I can see, the change to cmake)
See http://lists.kde.org/?l=kde-multimedia&m=134903246822765

Based on patches by the following people
CCMAIL: info@pc-tiede.de
CCMAIL: artjom.simon@gmail.com

BUG: 322370
FIXED-IN: 4.11.1
parent ee3f5559
......@@ -9,9 +9,9 @@ endif(FLAC_FOUND)
macro_optional_find_package(OggVorbis)
macro_log_feature(OGGVORBIS_FOUND "OggVorbis" "Libraries for Ogg Vorbis general audio compression codec" "http://www.xiph.org" FALSE "" "Required for the AudioCD Ogg Vorbis plugin.")
if (OGGVORBIS_FOUND)
if (OGGVORBIS_FOUND AND HAVE_LIBVORBISENC2)
add_subdirectory( vorbis )
endif(OGGVORBIS_FOUND)
endif(OGGVORBIS_FOUND AND HAVE_LIBVORBISENC2)
add_subdirectory( wav )
add_subdirectory( lame )
......
......@@ -4,8 +4,6 @@ include_directories( ${LIBKCDDB_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${
########### next target ###############
add_definitions(-DHAVE_VORBIS)
set(audiocd_encoder_vorbis_PART_SRCS encodervorbis.cpp )
......
......@@ -25,8 +25,6 @@
#include "encodervorbis.h"
#include "audiocd_vorbis_encoder.h"
#ifdef HAVE_VORBIS
#include <vorbis/vorbisenc.h>
#include <time.h>
#include <stdlib.h>
......@@ -139,11 +137,8 @@ void EncoderVorbis::loadSettings(){
// Now that we have read in the settings apply them to the encoder lib
switch (d->vorbis_encode_method) {
case 0:
/* Support very old libvorbis by simply falling through. */
#if HAVE_VORBIS >= 2
vorbis_encode_init_vbr(&d->vi, 2, 44100, d->vorbis_quality/10.0);
break;
#endif
case 1:
vorbis_encode_init(&d->vi, 2, 44100, d->vorbis_bitrate_upper, d->vorbis_bitrate_nominal, d->vorbis_bitrate_lower);
break;
......@@ -155,18 +150,11 @@ long EncoderVorbis::flush_vorbis(void) {
long processed(0);
while(vorbis_analysis_blockout(&d->vd,&d->vb)==1) {
/* Support ancient libvorbis (< RC3). */
#if HAVE_VORBIS >= 2
vorbis_analysis(&d->vb,NULL);
/* Non-ancient case. */
vorbis_bitrate_addblock(&d->vb);
while(vorbis_bitrate_flushpacket(&d->vd, &d->op)) {
#else
vorbis_analysis(&d->vb,&d->op);
/* Make a lexical block to place the #ifdef's nearby. */
if (1) {
#endif
ogg_stream_packetin(&d->os,&d->op);
while(int result=ogg_stream_pageout(&d->os,&d->og)) {
if (!result) break;
......@@ -193,9 +181,6 @@ unsigned long EncoderVorbis::size(long time_secs) const {
switch (d->vorbis_encode_method)
{
case 0: // quality based encoding
#if HAVE_VORBIS >= 2 // If really old Vorbis is being used, skip this nicely.
{
// Estimated numbers based on the Vorbis FAQ:
// http://www.xiph.org/archives/vorbis-faq/200203/0030.html
......@@ -209,9 +194,6 @@ unsigned long EncoderVorbis::size(long time_secs) const {
break;
}
#endif // HAVE_VORBIS >= 2
default: // bitrate based encoding
vorbis_size = (time_secs * d->vorbis_bitrate/8);
break;
......@@ -321,5 +303,3 @@ void EncoderVorbis::fillSongInfo( KCDDB::CDInfo info, int track, const QString &
}
}
#endif // HAVE_VORBIS
......@@ -26,7 +26,6 @@
#define ENCODER_VORBIS_H
#include "ui_encodervorbisconfig.h"
#ifdef HAVE_VORBIS
#include <audiocdencoder.h>
......@@ -41,7 +40,6 @@ public:
/**
* Ogg Vorbis encoder.
* This encoder is only enabled when HAVE_VORBIS is set.
* Check out http://www.vorbis.com/ for lots of information.
*/
class EncoderVorbis : public AudioCDEncoder {
......@@ -70,7 +68,5 @@ private:
};
#endif // HAVE_VORBIS
#endif // ENCODER_VORBIS_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment