ALT Linux Bugzilla
– Attachment 1814 Details for
Bug 10870
unsupported flac >= 1.1.3
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
kdemultimedia-3.5.5-flac.patch
kdemultimedia-3.5.5-flac.patch (text/plain), 14.45 KB, created by
led
on 2007-02-19 18:28:21 MSK
(
hide
)
Description:
kdemultimedia-3.5.5-flac.patch
Filename:
MIME Type:
Creator:
led
Created:
2007-02-19 18:28:21 MSK
Size:
14.45 KB
patch
obsolete
>diff -urN kdemultimedia-3.5.5.orig/kioslave/audiocd/configure.in.in kdemultimedia-3.5.5/kioslave/audiocd/configure.in.in >--- kdemultimedia-3.5.5.orig/kioslave/audiocd/configure.in.in 2005-09-10 11:19:49 +0300 >+++ kdemultimedia-3.5.5/kioslave/audiocd/configure.in.in 2007-01-16 01:01:39 +0200 >@@ -5,7 +5,7 @@ > have_libFLAC=no > KDE_CHECK_HEADER(FLAC/metadata.h, > [ >- KDE_CHECK_LIB(FLAC,FLAC__seekable_stream_decoder_process_single, >+ KDE_CHECK_LIB(FLAC,FLAC__stream_decoder_process_single, > have_libFLAC=yes) > > ]) >diff -urN kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/audiocd_flac_encoder.kcfg kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/audiocd_flac_encoder.kcfg >--- kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/audiocd_flac_encoder.kcfg 1970-01-01 03:00:00 +0300 >+++ kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/audiocd_flac_encoder.kcfg 2007-01-16 01:02:33 +0200 >@@ -0,0 +1,16 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 >+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > >+ <kcfgfile name="kcmaudiocd_encoder_flac_rc"/> >+ <group name="FLAC"> >+ >+ <entry name="compression_level" type="Int"> >+ <label>Preset Compression Level</label> >+ <default>5</default> >+ </entry> >+ >+ </group> >+</kcfg> >+ >diff -urN kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/audiocd_flac_encoder.kcfgc kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/audiocd_flac_encoder.kcfgc >--- kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/audiocd_flac_encoder.kcfgc 1970-01-01 03:00:00 +0300 >+++ kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/audiocd_flac_encoder.kcfgc 2007-01-16 01:02:33 +0200 >@@ -0,0 +1,4 @@ >+# Code generation options for kconfig_compiler >+File=audiocd_flac_encoder.kcfg >+ClassName=Settings >+Singleton=true >diff -urN kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/encoderflacconfig.ui kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/encoderflacconfig.ui >--- kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/encoderflacconfig.ui 1970-01-01 03:00:00 +0300 >+++ kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/encoderflacconfig.ui 2007-01-16 01:02:33 +0200 >@@ -0,0 +1,90 @@ >+<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> >+<class>EncoderFlacConfig</class> >+<widget class="QWidget"> >+ <property name="name"> >+ <cstring>FlacConfig</cstring> >+ </property> >+ <property name="geometry"> >+ <rect> >+ <x>0</x> >+ <y>0</y> >+ <width>489</width> >+ <height>314</height> >+ </rect> >+ </property> >+ <hbox> >+ <property name="name"> >+ <cstring>unnamed</cstring> >+ </property> >+ <widget class="QGroupBox"> >+ <property name="name"> >+ <cstring>groupBox8</cstring> >+ </property> >+ <property name="title"> >+ <string>&Preset Compression Level</string> >+ </property> >+ <hbox> >+ <property name="name"> >+ <cstring>unnamed</cstring> >+ </property> >+ <widget class="QLayoutWidget"> >+ <property name="name"> >+ <cstring>Layout21</cstring> >+ </property> >+ <hbox> >+ <property name="name"> >+ <cstring>unnamed</cstring> >+ </property> >+ <property name="margin"> >+ <number>0</number> >+ </property> >+ <property name="spacing"> >+ <number>6</number> >+ </property> >+ <widget class="QLabel"> >+ <property name="name"> >+ <cstring>TextLabel3_2</cstring> >+ </property> >+ <property name="text"> >+ <string>Fast</string> >+ </property> >+ </widget> >+ <widget class="QSlider"> >+ <property name="name"> >+ <cstring>kcfg_compression_level</cstring> >+ </property> >+ <property name="minValue"> >+ <number>0</number> >+ </property> >+ <property name="maxValue"> >+ <number>8</number> >+ </property> >+ <property name="pageStep"> >+ <number>1</number> >+ </property> >+ <property name="value"> >+ <number>5</number> >+ </property> >+ <property name="orientation"> >+ <enum>Horizontal</enum> >+ </property> >+ <property name="tickmarks"> >+ <enum>Below</enum> >+ </property> >+ </widget> >+ <widget class="QLabel"> >+ <property name="name"> >+ <cstring>TextLabel2_2</cstring> >+ </property> >+ <property name="text"> >+ <string>Best</string> >+ </property> >+ </widget> >+ </hbox> >+ </widget> >+ </hbox> >+ </widget> >+ </hbox> >+</widget> >+<layoutdefaults spacing="6" margin="11"/> >+</UI> >diff -urN kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/encoderflac.cpp kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/encoderflac.cpp >--- kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/encoderflac.cpp 2006-01-19 18:40:33 +0200 >+++ kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/encoderflac.cpp 2007-01-16 01:08:47 +0200 >@@ -19,6 +19,8 @@ > */ > > #include "encoderflac.h" >+#include "audiocd_flac_encoder.h" >+#include "encoderflacconfig.h" > > #ifdef HAVE_LIBFLAC > >@@ -29,6 +31,11 @@ > #include <kconfig.h> > #include <kdebug.h> > >+#if !defined FLAC_API_VERSION_CURRENT || FLAC_API_VERSION_CURRENT < 8 >+#define LEGACY_FLAC >+#else >+#undef LEGACY_FLAC >+#endif > > extern "C" > { >@@ -38,6 +45,140 @@ > } > } > >+struct FLACSettings { >+ bool verify; /**< -V */ >+ bool subset; /**< --no-lax */ >+ bool mid_side_stereo; /**< -m */ >+ bool loose_mid_side_stereo; /**< -M */ >+ uint blocksize; /**< -b */ >+ uint max_lpc_order; /**< -l */ >+ uint qlp_coef_prec; /**< -q */ >+ bool qlp_coef_prec_search; /**< -p */ >+ bool exhaustive_model_search; /**< -e */ >+ uint min_residual_part_order; /**< -r */ >+ uint max_residual_part_order; /**< -r */ >+}; >+ >+static FLACSettings presets[] = { >+ { /* compression level 0 */ >+ false, >+ true, >+ false, >+ false, >+ 1152, >+ 0, >+ 0, >+ false, >+ false, >+ 2, >+ 2 >+ }, >+ { /* compression level 1 */ >+ false, >+ true, >+ false, >+ true, >+ 1152, >+ 0, >+ 0, >+ false, >+ false, >+ 2, >+ 2 >+ }, >+ { /* compression level 2 */ >+ false, >+ true, >+ true, >+ false, >+ 1152, >+ 0, >+ 0, >+ false, >+ false, >+ 0, >+ 3 >+ }, >+ { /* compression level 3 */ >+ false, >+ true, >+ false, >+ false, >+ 4608, >+ 6, >+ 0, >+ false, >+ false, >+ 3, >+ 3 >+ }, >+ { /* compression level 4 */ >+ false, >+ true, >+ false, >+ true, >+ 4608, >+ 8, >+ 0, >+ false, >+ false, >+ 3, >+ 3 >+ }, >+ { /* compression level 5 */ >+ false, >+ true, >+ true, >+ false, >+ 4608, >+ 8, >+ 0, >+ false, >+ false, >+ 3, >+ 3 >+ }, >+ { /* compression level 6 */ >+ false, >+ true, >+ true, >+ false, >+ 4608, >+ 8, >+ 0, >+ false, >+ false, >+ 0, >+ 4 >+ }, >+ { /* compression level 7 */ >+ false, >+ true, >+ true, >+ false, >+ 4608, >+ 8, >+ 0, >+ false, >+ true, >+ 0, >+ 6 >+ }, >+ { /* compression level 7 */ >+ false, >+ true, >+ true, >+ false, >+ 4608, >+ 12, >+ 0, >+ false, >+ true, >+ 0, >+ 6 >+ } >+}; >+ > class EncoderFLAC::Private { > > public: >@@ -45,9 +186,46 @@ > FLAC__StreamMetadata** metadata; > KIO::SlaveBase* ioslave; > unsigned long data; >+ >+ void loadSettings(const FLACSettings& s); >+ void loadPreset(uint preset); > }; > >+void EncoderFLAC::Private::loadSettings(const FLACSettings& s) >+{ >+ FLAC__stream_encoder_set_verify(encoder, s.verify); >+ FLAC__stream_encoder_set_streamable_subset(encoder, s.subset); >+ >+ FLAC__stream_encoder_set_do_mid_side_stereo(encoder, s.mid_side_stereo); >+ FLAC__stream_encoder_set_loose_mid_side_stereo(encoder, s.loose_mid_side_stereo); >+ >+ FLAC__stream_encoder_set_blocksize(encoder, s.blocksize); >+ FLAC__stream_encoder_set_max_lpc_order(encoder, s.max_lpc_order); >+ >+ FLAC__stream_encoder_set_qlp_coeff_precision(encoder, s.qlp_coef_prec); >+ FLAC__stream_encoder_set_do_qlp_coeff_prec_search(encoder, s.qlp_coef_prec_search); >+ >+ FLAC__stream_encoder_set_do_exhaustive_model_search(encoder, s.exhaustive_model_search); >+ FLAC__stream_encoder_set_min_residual_partition_order(encoder, s.min_residual_part_order); >+ FLAC__stream_encoder_set_max_residual_partition_order(encoder, s.max_residual_part_order); >+} >+ >+void EncoderFLAC::Private::loadPreset(uint preset) >+{ >+ size_t max_preset = sizeof(presets) / sizeof(presets[0]); >+// Q_ASSERT(preset < max_preset); >+ // be more tolerant ;-) >+ if (preset >= max_preset) { >+ preset = max_preset - 1; >+ } >+ loadSettings(presets[preset]); >+} >+ >+#ifdef LEGACY_FLAC > static FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data) >+#else >+static FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data) >+#endif > { > EncoderFLAC::Private *d = (EncoderFLAC::Private*)client_data; > >@@ -74,13 +252,17 @@ > static FLAC__SeekableStreamEncoderSeekStatus SeekCallback(const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) > {} ; */ > >+#include <kglobal.h> >+#include <klocale.h> >+ >+#include <qslider.h> > > > > EncoderFLAC::EncoderFLAC(KIO::SlaveBase *slave) : AudioCDEncoder(slave) { > d = new Private(); > d->ioslave = slave; >- d->encoder = 0; >+ d->encoder = NULL; > } > > EncoderFLAC::~EncoderFLAC() { >@@ -95,9 +277,24 @@ > return true; > } > >-void EncoderFLAC::loadSettings() { >-// config->setGroup("FLAC"); >+QWidget* EncoderFLAC::getConfigureWidget(KConfigSkeleton** manager) const { >+ (*manager) = Settings::self(); >+ KGlobal::locale()->insertCatalogue("audiocd_encoder_flac"); >+ EncoderFlacConfig *config = new EncoderFlacConfig(); >+ config->kcfg_compression_level->setValue(5); >+ return config; >+} > >+void EncoderFLAC::loadSettings() { >+ kdDebug(7117) << "EncoderFLAC::loadSettings() called"<< endl; >+ Settings *settings = Settings::self(); >+ // make sure we deal with the _current_ config. >+ // unfortunately current (3.4.x) kconfig machinery doesn't >+ // guaranty that config changes will be delivered to all >+ // currently running applications. This makes hard to predict >+ // what config values will be used for pre-loaded konqueror instances >+ settings->readConfig(); >+ d->loadPreset(settings->compression_level()); > } > > // Estimate size to be 5/8 of uncompresed size. >@@ -109,22 +306,25 @@ > long EncoderFLAC::readInit(long size) { > kdDebug(7117) << "EncoderFLAC::readInit() called"<< endl; > d->data = 0; >+#ifdef LEGACY_FLAC > FLAC__stream_encoder_set_write_callback(d->encoder, WriteCallback); > FLAC__stream_encoder_set_metadata_callback(d->encoder, MetadataCallback); > FLAC__stream_encoder_set_client_data(d->encoder, d); >+#endif >+ >+ // make sure we loaded the most recent settings >+ loadSettings(); > >- // The options match approximely those of flac compression-level-3 >- FLAC__stream_encoder_set_do_mid_side_stereo(d->encoder, true); >- FLAC__stream_encoder_set_loose_mid_side_stereo(d->encoder, true); // flac -M >- FLAC__stream_encoder_set_max_lpc_order(d->encoder, 6); // flac -l6 >- FLAC__stream_encoder_set_min_residual_partition_order(d->encoder, 3); >- FLAC__stream_encoder_set_max_residual_partition_order(d->encoder, 3); // flac -r3,3 >- FLAC__stream_encoder_set_blocksize(d->encoder, 4608); >- FLAC__stream_encoder_set_streamable_subset(d->encoder, true); > if (size > 0) > FLAC__stream_encoder_set_total_samples_estimate(d->encoder, size/4); > >- FLAC__stream_encoder_init(d->encoder); >+#ifdef LEGACY_FLAC >+ if(FLAC__stream_encoder_init(d->encoder) != FLAC__STREAM_ENCODER_OK) >+ ; // really should handle an init failure >+#else >+ if(FLAC__stream_encoder_init_stream(d->encoder, WriteCallback, NULL, NULL, MetadataCallback, d) != FLAC__STREAM_ENCODER_INIT_STATUS_OK) >+ ; // really should handle an init failure >+#endif > return d->data; > } > >diff -urN kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/encoderflac.h kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/encoderflac.h >--- kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/encoderflac.h 2005-09-10 11:19:49 +0300 >+++ kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/encoderflac.h 2007-01-16 01:02:33 +0200 >@@ -49,6 +49,8 @@ > virtual long read(int16_t * buf, int frames); > virtual long readCleanup(); > >+ virtual QWidget* getConfigureWidget(KConfigSkeleton** manager) const; >+ > class Private; > private: > Private * d; >diff -urN kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/Makefile.am kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/Makefile.am >--- kdemultimedia-3.5.5.orig/kioslave/audiocd/plugins/flac/Makefile.am 2005-09-10 11:19:49 +0300 >+++ kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/Makefile.am 2007-01-16 01:02:33 +0200 >@@ -1,8 +1,10 @@ > INCLUDES = -I$(top_srcdir)/libkcddb -I$(srcdir)/.. $(all_includes) > >+kde_kcfg_DATA = audiocd_flac_encoder.kcfg >+ > kde_module_LTLIBRARIES = libaudiocd_encoder_flac.la > >-libaudiocd_encoder_flac_la_SOURCES = encoderflac.cpp >+libaudiocd_encoder_flac_la_SOURCES = audiocd_flac_encoder.kcfgc encoderflac.cpp encoderflacconfig.ui > > libaudiocd_encoder_flac_la_LIBADD = $(LIBFLAC) $(LIB_KIO) ../libaudiocdplugins.la >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 10870
: 1814