1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

Update to FLAC 1.2.1. This version includes two and a half years

worth of changes and an altered API.

Bump the revision of all ports that depend on libFLAC and adapt to
the new API where necessary.  Some patches from Debian, Gentoo,
OpenBSD, and upstream repositories.

PR:	119476
This commit is contained in:
Christian Weisgerber 2008-04-07 20:37:23 +00:00
parent e736f59941
commit fc6f899691
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=210771
112 changed files with 2474 additions and 1818 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= akode-plugins-${PORTNAMESUFX}
PORTVERSION= 2.0.2
PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= audio kde
MASTER_SITES= ${MASTER_SITE_GENTOO}

View File

@ -0,0 +1,11 @@
--- akode/plugins/xiph_decoder/flac113_decoder.cpp.orig 2008-03-27 16:11:26.000000000 +0100
+++ akode/plugins/xiph_decoder/flac113_decoder.cpp 2008-03-27 16:11:46.000000000 +0100
@@ -108,7 +108,7 @@ struct FLACDecoder::private_data {
static FLAC__StreamDecoderReadStatus flac_read_callback(
const FLAC__StreamDecoder *,
FLAC__byte buffer[],
- unsigned *bytes,
+ size_t *bytes,
void *client_data)
{
FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data;

View File

@ -7,6 +7,7 @@
PORTNAME= aqualung
DISTVERSION= 0.9beta9
PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= SF
@ -16,7 +17,7 @@ COMMENT= Music player with rich features
LIB_DEPENDS= jack.0:${PORTSDIR}/audio/jack \
samplerate.1:${PORTSDIR}/audio/libsamplerate \
sndfile.1:${PORTSDIR}/audio/libsndfile \
FLAC.7:${PORTSDIR}/audio/flac \
FLAC.10:${PORTSDIR}/audio/flac \
vorbis.4:${PORTSDIR}/audio/libvorbis \
oggz.3:${PORTSDIR}/audio/liboggz \
speex.1:${PORTSDIR}/audio/speex \

View File

@ -7,7 +7,7 @@
PORTNAME= flac
PORTVERSION= 20040316
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= audio
MASTER_SITES= http://ccm.sherry.jp/tmp/
PKGNAMEPREFIX= bmp-
@ -17,7 +17,7 @@ MAINTAINER= nork@FreeBSD.org
COMMENT= FLAC input plugin for beep-media-player
LIB_DEPENDS= beep.2:${PORTSDIR}/multimedia/beep-media-player \
FLAC.7:${PORTSDIR}/audio/flac
FLAC.10:${PORTSDIR}/audio/flac
PLIST_FILES= lib/bmp/Input/libbmp-flac.so
@ -33,8 +33,10 @@ post-patch:
@${REINPLACE_CMD} -e 's|echo aout|echo elf|' ${WRKSRC}/configure
# "obj" is magic to our make(1)
# make sure we get the new includes from ${LOCALBASE}/include/FLAC
post-configure:
@${RM} -rf ${WRKSRC}/obj
@${RM} -rf ${WRKSRC}/include/FLAC
# This is to avoid libtool running ldconfig -m ${X11BASE}/lib/bmp/Input
do-install:

View File

@ -0,0 +1,153 @@
--- src/plugin_bmp/plugin.c.orig 2008-04-06 19:21:13.000000000 +0200
+++ src/plugin_bmp/plugin.c 2008-04-06 19:45:38.000000000 +0200
@@ -80,12 +80,12 @@ static void FLAC_XMMS__cleanup();
static void FLAC_XMMS__get_song_info(char *filename, char **title, int *length);
static void *play_loop_(void *arg);
-static FLAC__bool safe_decoder_init_(const char *filename, FLAC__FileDecoder *decoder);
-static void safe_decoder_finish_(FLAC__FileDecoder *decoder);
-static void safe_decoder_delete_(FLAC__FileDecoder *decoder);
-static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
-static void metadata_callback_(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
-static void error_callback_(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
+static FLAC__bool safe_decoder_init_(const char *filename, FLAC__StreamDecoder *decoder);
+static void safe_decoder_finish_(FLAC__StreamDecoder *decoder);
+static void safe_decoder_delete_(FLAC__StreamDecoder *decoder);
+static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
+static void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
+static void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
InputPlugin flac_ip =
{
@@ -120,7 +120,7 @@ InputPlugin flac_ip =
static FLAC__byte sample_buffer_[SAMPLE_BUFFER_SIZE];
static unsigned sample_buffer_first_, sample_buffer_last_;
-static FLAC__FileDecoder *decoder_ = 0;
+static FLAC__StreamDecoder *decoder_ = 0;
static file_info_struct file_info_;
static pthread_t decode_thread_;
static FLAC__bool audio_error_ = false;
@@ -186,7 +186,7 @@ void FLAC_XMMS__init()
if(!xmms_cfg_read_int(cfg, "flac", "output.resolution.replaygain.bps_out", &flac_cfg.output.resolution.replaygain.bps_out))
flac_cfg.output.resolution.replaygain.bps_out = 16;
- decoder_ = FLAC__file_decoder_new();
+ decoder_ = FLAC__stream_decoder_new();
xmms_cfg_free(cfg);
}
@@ -359,11 +359,11 @@ void *play_loop_(void *arg)
unsigned s;
s = sample_buffer_last_ - sample_buffer_first_;
- if(FLAC__file_decoder_get_state(decoder_) == FLAC__FILE_DECODER_END_OF_FILE) {
+ if(FLAC__stream_decoder_get_state(decoder_) == FLAC__STREAM_DECODER_END_OF_STREAM) {
file_info_.eof = true;
break;
}
- else if(!FLAC__file_decoder_process_single(decoder_)) {
+ else if(!FLAC__stream_decoder_process_single(decoder_)) {
/*@@@ this should probably be a dialog */
fprintf(stderr, "libxmms-flac: READ ERROR processing frame\n");
file_info_.eof = true;
@@ -371,7 +371,7 @@ void *play_loop_(void *arg)
}
blocksize = sample_buffer_last_ - sample_buffer_first_ - s;
decode_position_frame_last = decode_position_frame;
- if(!FLAC__file_decoder_get_decode_position(decoder_, &decode_position_frame))
+ if(!FLAC__stream_decoder_get_decode_position(decoder_, &decode_position_frame))
decode_position_frame = 0;
}
if(sample_buffer_last_ - sample_buffer_first_ > 0) {
@@ -413,10 +413,10 @@ void *play_loop_(void *arg)
if(file_info_.seek_to_in_sec != -1) {
const double distance = (double)file_info_.seek_to_in_sec * 1000.0 / (double)file_info_.length_in_msec;
unsigned target_sample = (unsigned)(distance * (double)file_info_.total_samples);
- if(FLAC__file_decoder_seek_absolute(decoder_, (FLAC__uint64)target_sample)) {
+ if(FLAC__stream_decoder_seek_absolute(decoder_, (FLAC__uint64)target_sample)) {
flac_ip.output->flush(file_info_.seek_to_in_sec * 1000);
bh_index_last_w = bh_index_last_o = flac_ip.output->output_time() / BITRATE_HIST_SEGMENT_MSEC % BITRATE_HIST_SIZE;
- if(!FLAC__file_decoder_get_decode_position(decoder_, &decode_position_frame))
+ if(!FLAC__stream_decoder_get_decode_position(decoder_, &decode_position_frame))
decode_position_frame = 0;
file_info_.seek_to_in_sec = -1;
file_info_.eof = false;
@@ -445,46 +445,41 @@ void *play_loop_(void *arg)
return 0; /* to silence the compiler warning about not returning a value */
}
-FLAC__bool safe_decoder_init_(const char *filename, FLAC__FileDecoder *decoder)
+FLAC__bool safe_decoder_init_(const char *filename, FLAC__StreamDecoder *decoder)
{
if(decoder == 0)
return false;
safe_decoder_finish_(decoder);
- FLAC__file_decoder_set_md5_checking(decoder, false);
- FLAC__file_decoder_set_filename(decoder, filename);
- FLAC__file_decoder_set_metadata_ignore_all(decoder);
- FLAC__file_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO);
- FLAC__file_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);
- FLAC__file_decoder_set_write_callback(decoder, write_callback_);
- FLAC__file_decoder_set_metadata_callback(decoder, metadata_callback_);
- FLAC__file_decoder_set_error_callback(decoder, error_callback_);
- FLAC__file_decoder_set_client_data(decoder, &file_info_);
- if(FLAC__file_decoder_init(decoder) != FLAC__FILE_DECODER_OK)
+ FLAC__stream_decoder_set_md5_checking(decoder, false);
+ FLAC__stream_decoder_set_metadata_ignore_all(decoder);
+ FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO);
+ FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);
+ if(FLAC__stream_decoder_init_file(decoder, filename, write_callback_, metadata_callback_, error_callback_, /*client_data=*/&file_info_) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
return false;
- if(!FLAC__file_decoder_process_until_end_of_metadata(decoder))
+ if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder))
return false;
return true;
}
-void safe_decoder_finish_(FLAC__FileDecoder *decoder)
+void safe_decoder_finish_(FLAC__StreamDecoder *decoder)
{
- if(decoder && FLAC__file_decoder_get_state(decoder) != FLAC__FILE_DECODER_UNINITIALIZED)
- FLAC__file_decoder_finish(decoder);
+ if(decoder && FLAC__stream_decoder_get_state(decoder) != FLAC__STREAM_DECODER_UNINITIALIZED)
+ FLAC__stream_decoder_finish(decoder);
}
-void safe_decoder_delete_(FLAC__FileDecoder *decoder)
+void safe_decoder_delete_(FLAC__StreamDecoder *decoder)
{
if(decoder) {
safe_decoder_finish_(decoder);
- FLAC__file_decoder_delete(decoder);
+ FLAC__stream_decoder_delete(decoder);
}
}
-FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
+FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
{
file_info_struct *file_info = (file_info_struct *)client_data;
const unsigned channels = file_info->channels, wide_samples = frame->header.blocksize;
@@ -544,7 +539,7 @@ FLAC__StreamDecoderWriteStatus write_cal
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
-void metadata_callback_(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
+void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
{
file_info_struct *file_info = (file_info_struct *)client_data;
(void)decoder;
@@ -565,7 +560,7 @@ void metadata_callback_(const FLAC__File
}
}
-void error_callback_(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
+void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
{
file_info_struct *file_info = (file_info_struct *)client_data;
(void)decoder;

View File

@ -0,0 +1,85 @@
--- src/share/grabbag/replaygain.c.orig 2004-02-12 09:00:39.000000000 +0100
+++ src/share/grabbag/replaygain.c 2008-04-06 21:03:18.000000000 +0200
@@ -19,8 +19,8 @@
#include "share/grabbag.h"
#include "share/replaygain_analysis.h"
#include "FLAC/assert.h"
-#include "FLAC/file_decoder.h"
#include "FLAC/metadata.h"
+#include "FLAC/stream_decoder.h"
#include <locale.h>
#include <math.h>
#include <stdio.h>
@@ -266,7 +266,7 @@
FLAC__bool error;
} DecoderInstance;
-static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
+static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
{
DecoderInstance *instance = (DecoderInstance*)client_data;
const unsigned bits_per_sample = frame->header.bits_per_sample;
@@ -295,7 +295,7 @@
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
-static void metadata_callback_(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
+static void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
{
DecoderInstance *instance = (DecoderInstance*)client_data;
@@ -318,7 +318,7 @@
}
}
-static void error_callback_(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
+static void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
{
DecoderInstance *instance = (DecoderInstance*)client_data;
@@ -330,7 +330,7 @@
const char *grabbag__replaygain_analyze_file(const char *filename, float *title_gain, float *title_peak)
{
DecoderInstance instance;
- FLAC__FileDecoder *decoder = FLAC__file_decoder_new();
+ FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new();
if(0 == decoder)
return "memory allocation error";
@@ -338,27 +338,22 @@
instance.error = false;
/* It does these three by default but lets be explicit: */
- FLAC__file_decoder_set_md5_checking(decoder, false);
- FLAC__file_decoder_set_metadata_ignore_all(decoder);
- FLAC__file_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO);
-
- FLAC__file_decoder_set_filename(decoder, filename);
- FLAC__file_decoder_set_write_callback(decoder, write_callback_);
- FLAC__file_decoder_set_metadata_callback(decoder, metadata_callback_);
- FLAC__file_decoder_set_error_callback(decoder, error_callback_);
- FLAC__file_decoder_set_client_data(decoder, &instance);
+ FLAC__stream_decoder_set_md5_checking(decoder, false);
+ FLAC__stream_decoder_set_metadata_ignore_all(decoder);
+ FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO);
- if(FLAC__file_decoder_init(decoder) != FLAC__FILE_DECODER_OK) {
- FLAC__file_decoder_delete(decoder);
+
+ if(FLAC__stream_decoder_init_file(decoder, filename, write_callback_, metadata_callback_, error_callback_, &instance) != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
+ FLAC__stream_decoder_delete(decoder);
return "initializing decoder";
}
- if(!FLAC__file_decoder_process_until_end_of_file(decoder) || instance.error) {
- FLAC__file_decoder_delete(decoder);
+ if(!FLAC__stream_decoder_process_until_end_of_stream(decoder) || instance.error) {
+ FLAC__stream_decoder_delete(decoder);
return "decoding file";
}
- FLAC__file_decoder_delete(decoder);
+ FLAC__stream_decoder_delete(decoder);
grabbag__replaygain_get_title(title_gain, title_peak);

View File

@ -7,7 +7,7 @@
PORTNAME= cmus
PORTVERSION= 2.2.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= audio
MASTER_SITES= http://onion.dynserv.net/~timo/files/ \
http://mirror.greaterscope.net/cmus/

View File

@ -7,7 +7,7 @@
PORTNAME= cynthiune
PORTVERSION= 0.9.5
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= audio gnustep
MASTER_SITES= ${MASTER_SITE_DEBIAN}
MASTER_SITE_SUBDIR= pool/main/c/cynthiune.app

View File

@ -0,0 +1,71 @@
--- Bundles/FLACTags/FLACTags.m.orig 2006-03-21 22:41:04.000000000 +0100
+++ Bundles/FLACTags/FLACTags.m 2008-03-27 17:23:35.000000000 +0100
@@ -78,14 +78,14 @@ processComment (FLAC__StreamMetadata_Vor
}
static FLAC__StreamDecoderWriteStatus
-writeCallback (const FLAC__FileDecoder *fileDecoder, const FLAC__Frame *frame,
+writeCallback (const FLAC__StreamDecoder *fileDecoder, const FLAC__Frame *frame,
const FLAC__int32 * const buffer[], void *clientData)
{
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
static void
-metadataCallback (const FLAC__FileDecoder *fileDecoder,
+metadataCallback (const FLAC__StreamDecoder *fileDecoder,
const FLAC__StreamMetadata *metadata,
void *clientData)
{
@@ -104,7 +104,7 @@ metadataCallback (const FLAC__FileDecode
}
static void
-errorCallback (const FLAC__FileDecoder *fileDecoder,
+errorCallback (const FLAC__StreamDecoder *fileDecoder,
FLAC__StreamDecoderErrorStatus status,
void *clientData)
{
@@ -132,30 +132,25 @@ errorCallback (const FLAC__FileDecoder *
year: (NSString **) year
ofFilename: (NSString *) filename
{
- FLAC__FileDecoder *fileDecoder;
+ FLAC__StreamDecoder *fileDecoder;
BOOL result;
NSString **arrayOfValues[] = { title, artist, album, trackNumber,
genre, year };
- fileDecoder = FLAC__file_decoder_new();
+ fileDecoder = FLAC__stream_decoder_new();
if (fileDecoder)
{
- FLAC__file_decoder_set_metadata_ignore_all (fileDecoder);
- FLAC__file_decoder_set_metadata_respond (fileDecoder,
+ FLAC__stream_decoder_set_metadata_ignore_all (fileDecoder);
+ FLAC__stream_decoder_set_metadata_respond (fileDecoder,
FLAC__METADATA_TYPE_VORBIS_COMMENT);
- FLAC__file_decoder_set_metadata_callback (fileDecoder,
- metadataCallback);
- FLAC__file_decoder_set_write_callback (fileDecoder, writeCallback);
- FLAC__file_decoder_set_error_callback (fileDecoder, errorCallback);
- FLAC__file_decoder_set_client_data (fileDecoder, arrayOfValues);
-
- result = (FLAC__file_decoder_set_filename (fileDecoder,
- [filename cString])
- && (FLAC__file_decoder_init (fileDecoder)
- == FLAC__FILE_DECODER_OK)
- && FLAC__file_decoder_process_until_end_of_metadata
- (fileDecoder));
- FLAC__file_decoder_delete (fileDecoder);
+ result = (FLAC__stream_decoder_init_file (fileDecoder,
+ [filename cString],
+ writeCallback, metadataCallback,
+ errorCallback,
+ *arrayOfValues)
+ == FLAC__STREAM_DECODER_INIT_STATUS_OK)
+ && FLAC__stream_decoder_process_until_end_of_metadata (fileDecoder);
+ FLAC__stream_decoder_delete (fileDecoder);
}
else
result = NO;

View File

@ -0,0 +1,11 @@
--- Bundles/FLAC/FLAC.h.orig 2006-03-21 11:11:19.000000000 +0100
+++ Bundles/FLAC/FLAC.h 2008-03-27 17:23:35.000000000 +0100
@@ -31,7 +31,7 @@
@interface FLAC : NSObject <CynthiuneBundle, Format>
{
- FLAC__FileDecoder *fileDecoder;
+ FLAC__StreamDecoder *fileDecoder;
unsigned int bitsPerSample;
unsigned int duration;

View File

@ -0,0 +1,129 @@
--- Bundles/FLAC/FLAC.m.orig 2006-03-21 22:39:13.000000000 +0100
+++ Bundles/FLAC/FLAC.m 2008-03-27 17:23:35.000000000 +0100
@@ -39,7 +39,7 @@
#define LOCALIZED(X) _b ([FLAC class], X)
static FLAC__StreamDecoderWriteStatus
-writeCallback (const FLAC__FileDecoder *fileDecoder, const FLAC__Frame *frame,
+writeCallback (const FLAC__StreamDecoder *fileDecoder, const FLAC__Frame *frame,
const FLAC__int32 * const buffer[], void *clientData)
{
CFLAC *cStream;
@@ -70,7 +70,7 @@ writeCallback (const FLAC__FileDecoder *
}
static void
-metadataCallback (const FLAC__FileDecoder *fileDecoder,
+metadataCallback (const FLAC__StreamDecoder *fileDecoder,
const FLAC__StreamMetadata *metadata,
void *clientData)
{
@@ -88,7 +88,7 @@ metadataCallback (const FLAC__FileDecode
}
static void
-errorCallback (const FLAC__FileDecoder *fileDecoder,
+errorCallback (const FLAC__StreamDecoder *fileDecoder,
FLAC__StreamDecoderErrorStatus status,
void *clientData)
{
@@ -161,25 +161,24 @@ errorCallback (const FLAC__FileDecoder *
- (BOOL) _initializeFileDecoderWithFilename: (NSString *) fileName
{
- FLAC__file_decoder_set_metadata_ignore_all (fileDecoder);
- FLAC__file_decoder_set_metadata_respond (fileDecoder,
+ FLAC__stream_decoder_set_metadata_ignore_all (fileDecoder);
+ FLAC__stream_decoder_set_metadata_respond (fileDecoder,
FLAC__METADATA_TYPE_STREAMINFO);
- FLAC__file_decoder_set_metadata_callback (fileDecoder,
- metadataCallback);
- FLAC__file_decoder_set_write_callback (fileDecoder, writeCallback);
- FLAC__file_decoder_set_error_callback (fileDecoder, errorCallback);
- FLAC__file_decoder_set_client_data (fileDecoder, self);
-
- return (FLAC__file_decoder_set_filename (fileDecoder, [fileName cString])
- && (FLAC__file_decoder_init (fileDecoder) == FLAC__FILE_DECODER_OK)
- && FLAC__file_decoder_process_until_end_of_metadata (fileDecoder));
+ return (FLAC__stream_decoder_init_file (fileDecoder,
+ [fileName cString],
+ writeCallback,
+ metadataCallback,
+ errorCallback,
+ self)
+ == FLAC__STREAM_DECODER_INIT_STATUS_OK)
+ && FLAC__stream_decoder_process_until_end_of_metadata (fileDecoder);
}
- (BOOL) streamOpen: (NSString *) fileName
{
BOOL result;
- fileDecoder = FLAC__file_decoder_new();
+ fileDecoder = FLAC__stream_decoder_new();
if (fileDecoder)
{
@@ -187,7 +186,7 @@ errorCallback (const FLAC__FileDecoder *
result = YES;
else
{
- FLAC__file_decoder_delete (fileDecoder);
+ FLAC__stream_decoder_delete (fileDecoder);
fileDecoder = NULL;
result = NO;
}
@@ -200,7 +199,7 @@ errorCallback (const FLAC__FileDecoder *
- (void) streamClose
{
- FLAC__file_decoder_delete (fileDecoder);
+ FLAC__stream_decoder_delete (fileDecoder);
fileDecoder = NULL;
}
@@ -215,7 +214,7 @@ errorCallback (const FLAC__FileDecoder *
if (position >= readBufferSize)
{
position = 0;
- success = FLAC__file_decoder_process_single (fileDecoder);
+ success = FLAC__stream_decoder_process_single (fileDecoder);
}
if (success)
@@ -251,13 +250,13 @@ errorCallback (const FLAC__FileDecoder *
withSize: (unsigned int) bufferSize
{
int readBytes;
- FLAC__FileDecoderState state;
+ FLAC__StreamDecoderState state;
- state = FLAC__file_decoder_get_state (fileDecoder);
+ state = FLAC__stream_decoder_get_state (fileDecoder);
- if (state == FLAC__FILE_DECODER_OK)
+ if (state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC)
readBytes = [self _processNextChunk: buffer withSize: bufferSize];
- else if (state == FLAC__FILE_DECODER_END_OF_FILE)
+ else if (state == FLAC__STREAM_DECODER_END_OF_STREAM)
readBytes = 0;
else
readBytes = -1;
@@ -272,7 +271,7 @@ errorCallback (const FLAC__FileDecoder *
- (void) seek: (unsigned int) aPos
{
- FLAC__file_decoder_seek_absolute (fileDecoder, aPos * rate);
+ FLAC__stream_decoder_seek_absolute (fileDecoder, aPos * rate);
}
- (unsigned int) readChannels
@@ -295,7 +294,7 @@ errorCallback (const FLAC__FileDecoder *
if (readBuffer)
free (readBuffer);
if (fileDecoder)
- FLAC__file_decoder_delete (fileDecoder);
+ FLAC__stream_decoder_delete (fileDecoder);
[super dealloc];
}

View File

@ -7,6 +7,7 @@
PORTNAME= easytag
PORTVERSION= 2.1.5
PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}

View File

@ -7,7 +7,7 @@
PORTNAME= easytag
PORTVERSION= 2.1
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}

View File

@ -6,14 +6,10 @@
#
PORTNAME= flac
PORTVERSION= 1.1.2
PORTREVISION= 2
PORTVERSION= 1.2.1
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:S/$/:sf/} \
${MASTER_SITE_LOCAL:S/$/:local/}
MASTER_SITE_SUBDIR= ${PORTNAME}/:sf naddy/:local
DISTFILES= ${EXTRACT_ONLY}:sf flac-alloc.h:local
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
MAINTAINER= naddy@FreeBSD.org
COMMENT= Free lossless audio codec
@ -26,14 +22,17 @@ GNU_CONFIGURE= yes
CONFIGURE_TARGET= --target=${ARCH}-unknown-freebsd${OSREL}
CONFIGURE_ARGS= --enable-sse \
--with-libiconv-prefix="${LOCALBASE}" \
--with-ogg="${LOCALBASE}"
CONFIGURE_ENV= CPPFLAGS="-I${WRKSRC}/include" \
ac_cv_path_XMMS_CONFIG=no
--with-ogg="${LOCALBASE}" \
--disable-thorough-tests \
--disable-xmms-plugin
CONFIGURE_ENV= CPPFLAGS="-I${WRKSRC}/include"
MAKE_ARGS= pkgconfigdir="${PREFIX}/libdata/pkgconfig"
MAKE_ENV= MAKEOBJDIR=/nonexistent # ignore ${WRKSRC}/obj
.if defined(NOPORTDOCS)
MAKE_ENV= DOC=""
MAKE_ENV+= DOC=""
.else
MAKE_ENV= DOC=doc
MAKE_ENV+= DOC=doc
.endif
USE_LDCONFIG= yes
@ -42,20 +41,17 @@ MAN1= flac.1 metaflac.1
.include <bsd.port.pre.mk>
.if ${ARCH} == "i386"
BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
BUILD_DEPENDS+= nasm:${PORTSDIR}/devel/nasm
.endif
post-extract:
@${CP} ${DISTDIR}/flac-alloc.h ${WRKSRC}/include/share/alloc.h
# "obj" is magic to our make(1)
post-configure:
@${RM} -rf ${WRKSRC}/obj
pre-patch:
@${REINPLACE_CMD} 's:^docdir = $$(datadir)/doc/$$(PACKAGE)-$$(VERSION):docdir = $$(datadir)/doc/$$(PACKAGE):' \
`find ${WRKSRC}/doc -name Makefile.in`
post-build:
${REINPLACE_CMD} 's:%%PREFIX%%:${PREFIX}:' ${WRKSRC}/man/flac.1
test: build
@cd ${WRKSRC}; ${MAKE} check
@cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} check
.include <bsd.port.post.mk>

View File

@ -1,6 +1,3 @@
MD5 (flac-1.1.2.tar.gz) = 2bfc127cdda02834d0491ab531a20960
SHA256 (flac-1.1.2.tar.gz) = ce4f7d11b3c04a7368c916ca4abc284dd0c0256f461dfb7f07df1ab445e7a5c0
SIZE (flac-1.1.2.tar.gz) = 1516235
MD5 (flac-alloc.h) = 08891390039e2aee9bd4335f784467db
SHA256 (flac-alloc.h) = da40afc663e5b3fe6dccd1a0f1c218b7ec02d3699d72b41d6978696896d7df98
SIZE (flac-alloc.h) = 5697
MD5 (flac-1.2.1.tar.gz) = 153c8b15a54da428d1f0fadc756c22c7
SHA256 (flac-1.2.1.tar.gz) = 9635a44bceb478bbf2ee8a785cf6986fba525afb5fad1fd4bba73cf71f2d3edf
SIZE (flac-1.2.1.tar.gz) = 2009217

View File

@ -3,12 +3,12 @@ $FreeBSD$
--- Makefile.in.orig
+++ Makefile.in
@@ -258,7 +258,7 @@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-SUBDIRS = doc include man src test build flac.pbproj obj
+SUBDIRS = $(DOC) include man src test build flac.pbproj
@@ -234,7 +234,7 @@
AUTOMAKE_OPTIONS = foreign 1.7
-SUBDIRS = doc include m4 man src examples test build obj
+SUBDIRS = $(DOC) include m4 man src test build
DISTCLEANFILES = libtool-disable-static
EXTRA_DIST = \
COPYING.FDL \

View File

@ -3,15 +3,12 @@ $FreeBSD$
--- configure.orig
+++ configure
@@ -10541,9 +10541,9 @@
if test x$debug = xtrue; then
OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
else
- OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O2 -DNDEBUG"
+ OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -DNDEBUG"
if test x$GCC = xyes; then
- OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__"
+ OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -Wall -W -DFLaC__INLINE=__inline__"
@@ -23490,7 +23490,7 @@
CPPFLAGS="-DNDEBUG $CPPFLAGS"
if test "x$GCC" = xyes; then
CPPFLAGS="-DFLaC__INLINE=__inline__ $CPPFLAGS"
- CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS"
+ CFLAGS="-Wall -W $CFLAGS"
fi
fi
CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"

View File

@ -1,14 +0,0 @@
$FreeBSD$
--- doc/Makefile.in.orig
+++ doc/Makefile.in
@@ -236,7 +236,7 @@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = . html
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
+docdir = $(datadir)/doc/$(PACKAGE)
doc_DATA = \
FLAC.tag

View File

@ -1,35 +0,0 @@
$FreeBSD$
--- doc/html/Makefile.in.orig
+++ doc/html/Makefile.in
@@ -236,7 +236,7 @@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = ru images
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html
+docdir = $(datadir)/doc/$(PACKAGE)/html
doc_DATA = \
changelog.html \
comparison.html \
@@ -577,13 +577,13 @@
# The install targets don't copy whole directories so we have to
# handle 'api/' specially:
-@FLaC__HAS_DOXYGEN_TRUE@install-data-local:
-@FLaC__HAS_DOXYGEN_TRUE@ $(mkinstalldirs) $(DESTDIR)$(docdir)/api
-@FLaC__HAS_DOXYGEN_TRUE@ (cd api && $(INSTALL_DATA) * $(DESTDIR)$(docdir)/api)
-@FLaC__HAS_DOXYGEN_TRUE@uninstall-local:
-@FLaC__HAS_DOXYGEN_TRUE@ rm -rf $(DESTDIR)$(docdir)/api
-@FLaC__HAS_DOXYGEN_TRUE@maintainer-clean-local:
-@FLaC__HAS_DOXYGEN_TRUE@ rm -rf api
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(docdir)/api
+ (cd api && $(INSTALL_DATA) * $(DESTDIR)$(docdir)/api)
+uninstall-local:
+ rm -rf $(DESTDIR)$(docdir)/api
+maintainer-clean-local:
+ rm -rf api
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,14 +0,0 @@
$FreeBSD$
--- doc/html/images/Makefile.in.orig
+++ doc/html/images/Makefile.in
@@ -226,7 +226,7 @@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html/images
+docdir = $(datadir)/doc/$(PACKAGE)/html/images
doc_DATA = \
1x1.gif \
cafebug.gif \

View File

@ -1,14 +0,0 @@
$FreeBSD$
--- doc/html/ru/Makefile.in.orig
+++ doc/html/ru/Makefile.in
@@ -226,7 +226,7 @@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html/ru
+docdir = $(datadir)/doc/$(PACKAGE)/html/ru
doc_DATA = \
authors.html \
comparison.html \

View File

@ -3,13 +3,12 @@ $FreeBSD$
--- man/flac.1.orig
+++ man/flac.1
@@ -397,8 +397,7 @@
@@ -325,7 +325,7 @@
.PP
The programs are documented fully by HTML format
documentation, available in
-\fI/usr/share/doc/flac/html\fR on
-Debian GNU/Linux systems.
+\fI%%PREFIX%%/share/doc/flac/html\fR.
metaflac(1).
.PP
-The programs are documented fully by HTML format documentation, available in \fI/usr/share/doc/flac/html\fR on Debian GNU/Linux systems.
+The programs are documented fully by HTML format documentation, available in \fI%%PREFIX%%/share/doc/flac/html\fR.
.SH "AUTHOR"
.PP
This manual page was written by Matt Zimmerman <mdz@debian.org> for
This manual page was written by Matt Zimmerman <mdz@debian.org> for the Debian GNU/Linux system (but may be used by others).

View File

@ -1,66 +0,0 @@
$FreeBSD$
--- src/libFLAC++/metadata.cpp.orig
+++ src/libFLAC++/metadata.cpp
@@ -33,6 +33,7 @@
#include "FLAC/assert.h"
#include <stdlib.h> // for malloc(), free()
#include <string.h> // for memcpy() etc.
+#include "share/alloc.h"
#ifdef _MSC_VER
// warning C4800: 'int' : forcing to bool 'true' or 'false' (performance warning)
@@ -568,7 +569,7 @@
clear_entry();
- if(0 == (entry_.entry = (FLAC__byte*)malloc(field_length+1))) {
+ if(0 == (entry_.entry = (FLAC__byte*)safe_malloc_add_2op_(field_length, /*+*/1))) {
is_valid_ = false;
}
else {
@@ -617,7 +618,7 @@
clear_field_value();
- if(0 == (field_value_ = (char *)malloc(field_value_length+1))) {
+ if(0 == (field_value_ = (char *)safe_malloc_add_2op_(field_value_length, /*+*/1))) {
is_valid_ = false;
}
else {
@@ -707,7 +708,7 @@
{
clear_entry();
- if(0 == (entry_.entry = (FLAC__byte*)malloc(field_name_length_ + 1 + field_value_length_ + 1))) {
+ if(0 == (entry_.entry = (FLAC__byte*)safe_malloc_add_4op_(field_name_length_, /*+*/1, /*+*/field_value_length_, /*+*/1))) {
is_valid_ = false;
}
else {
@@ -733,7 +734,7 @@
p = (const char *)entry_.entry + entry_.length;
field_name_length_ = p - (const char *)entry_.entry;
- if(0 == (field_name_ = (char *)malloc(field_name_length_ + 1))) { // +1 for the trailing \0
+ if(0 == (field_name_ = (char *)safe_malloc_add_2op_(field_name_length_, /*+*/1))) { // +1 for the trailing \0
is_valid_ = false;
return;
}
@@ -742,14 +743,14 @@
if(entry_.length - field_name_length_ == 0) {
field_value_length_ = 0;
- if(0 == (field_value_ = (char *)malloc(0))) {
+ if(0 == (field_value_ = (char *)safe_malloc_(0))) {
is_valid_ = false;
return;
}
}
else {
field_value_length_ = entry_.length - field_name_length_ - 1;
- if(0 == (field_value_ = (char *)malloc(field_value_length_ + 1))) { // +1 for the trailing \0
+ if(0 == (field_value_ = (char *)safe_malloc_add_2op_(field_value_length_, /*+*/1))) { // +1 for the trailing \0
is_valid_ = false;
return;
}

View File

@ -3,11 +3,11 @@ $FreeBSD$
--- src/libFLAC/Makefile.in.orig
+++ src/libFLAC/Makefile.in
@@ -304,7 +304,6 @@
@FLaC__CPU_IA32_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_LIBADD = ia32/libFLAC-asm.la
@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_LIBADD = ppc/gas/libFLAC-asm.la
@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_LIBADD = ppc/as/libFLAC-asm.la
-@FLaC__CPU_PPC_TRUE@@FLaC__NO_ASM_FALSE@LOCAL_EXTRA_LDFLAGS = "-Wl,-read_only_relocs,warning"
SUBDIRS = $(ARCH_SUBDIRS) include .
m4datadir = $(datadir)/aclocal
m4data_DATA = libFLAC.m4
@@ -249,7 +249,6 @@
@FLaC__CPU_IA32_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@LOCAL_EXTRA_LIBADD = ia32/libFLAC-asm.la
@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__NO_ASM_FALSE@LOCAL_EXTRA_LIBADD = ppc/as/libFLAC-asm.la
@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__NO_ASM_FALSE@LOCAL_EXTRA_LIBADD = ppc/gas/libFLAC-asm.la
-@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__NO_ASM_FALSE@LOCAL_EXTRA_LDFLAGS = "-Wl,-read_only_relocs,warning"
@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__NO_ASM_FALSE@LOCAL_EXTRA_LDFLAGS = ""
libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@

View File

@ -1,31 +0,0 @@
$FreeBSD$
--- src/libFLAC/bitbuffer.c.orig
+++ src/libFLAC/bitbuffer.c
@@ -35,6 +35,7 @@
#include "private/bitmath.h"
#include "private/crc.h"
#include "FLAC/assert.h"
+#include "share/alloc.h"
/*
* Along the way you will see two versions of some functions, selected
@@ -193,7 +194,7 @@
if(bb->capacity == new_capacity)
return true;
- new_buffer = (FLAC__blurb*)calloc(new_capacity, sizeof(FLAC__blurb));
+ new_buffer = (FLAC__blurb*)safe_calloc_(new_capacity, sizeof(FLAC__blurb));
if(new_buffer == 0)
return false;
memcpy(new_buffer, bb->buffer, sizeof(FLAC__blurb)*min(bb->blurbs+(bb->bits?1:0), new_capacity));
@@ -425,7 +426,7 @@
{
if(bb->buffer == 0) {
bb->capacity = FLAC__BITBUFFER_DEFAULT_CAPACITY;
- bb->buffer = (FLAC__blurb*)calloc(bb->capacity, sizeof(FLAC__blurb));
+ bb->buffer = (FLAC__blurb*)safe_calloc_(bb->capacity, sizeof(FLAC__blurb));
if(bb->buffer == 0)
return false;
}

View File

@ -1,32 +0,0 @@
$FreeBSD$
--- src/libFLAC/cpu.c.orig
+++ src/libFLAC/cpu.c
@@ -37,6 +37,11 @@
#include <config.h>
#endif
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
+
#if defined FLAC__CPU_PPC
#if !defined FLAC__NO_ASM
#if defined FLAC__SYS_DARWIN
@@ -95,6 +100,14 @@
#ifndef FLAC__SSE_OS
info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = false;
+#elif defined(__FreeBSD__)
+ /* on FreeBSD we can double-check via sysctl whether the OS supports SSE */
+ {
+ int sse;
+ size_t len = sizeof(sse);
+ if (sysctlbyname("hw.instruction_sse", &sse, &len, NULL, 0) || !sse)
+ info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = false;
+ }
#endif
#ifdef FLAC__USE_3DNOW

View File

@ -1,22 +0,0 @@
$FreeBSD$
--- src/libFLAC/file_decoder.c.orig
+++ src/libFLAC/file_decoder.c
@@ -43,6 +43,7 @@
#include "FLAC/assert.h"
#include "protected/file_decoder.h"
#include "protected/seekable_stream_decoder.h"
+#include "share/alloc.h"
/***********************************************************************
*
@@ -248,7 +249,7 @@
decoder->private_->filename = 0;
}
if(0 != strcmp(value, "-")) {
- if(0 == (decoder->private_->filename = (char*)malloc(strlen(value)+1))) {
+ if(0 == (decoder->private_->filename = (char*)safe_malloc_add_2op_(strlen(value), /*+*/1))) {
decoder->protected_->state = FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR;
return false;
}

View File

@ -1,22 +0,0 @@
$FreeBSD$
--- src/libFLAC/file_encoder.c.orig
+++ src/libFLAC/file_encoder.c
@@ -34,6 +34,7 @@
#include <string.h> /* for strlen(), strcpy() */
#include "FLAC/assert.h"
#include "protected/file_encoder.h"
+#include "share/alloc.h"
#ifdef max
#undef max
@@ -436,7 +437,7 @@
free(encoder->private_->filename);
encoder->private_->filename = 0;
}
- if(0 == (encoder->private_->filename = (char*)malloc(strlen(value)+1))) {
+ if(0 == (encoder->private_->filename = (char*)safe_malloc_add_2op_(strlen(value), /*+*/1))) {
encoder->protected_->state = FLAC__FILE_ENCODER_MEMORY_ALLOCATION_ERROR;
return false;
}

View File

@ -1,25 +0,0 @@
$FreeBSD$
--- src/libFLAC/format.c.orig
+++ src/libFLAC/format.c
@@ -38,6 +38,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#include "share/alloc.h"
#ifdef min
#undef min
@@ -463,9 +464,9 @@
FLAC__ASSERT(object->capacity_by_order > 0 || (0 == object->parameters && 0 == object->raw_bits));
if(object->capacity_by_order < max_partition_order) {
- if(0 == (object->parameters = (unsigned*)realloc(object->parameters, sizeof(unsigned)*(1 << max_partition_order))))
+ if(0 == (object->parameters = (unsigned*)safe_realloc_mul_2op_(object->parameters, sizeof(unsigned), /*times*/(1 << max_partition_order))))
return false;
- if(0 == (object->raw_bits = (unsigned*)realloc(object->raw_bits, sizeof(unsigned)*(1 << max_partition_order))))
+ if(0 == (object->raw_bits = (unsigned*)safe_realloc_mul_2op_(object->raw_bits, sizeof(unsigned), /*times*/(1 << max_partition_order))))
return false;
object->capacity_by_order = max_partition_order;
}

View File

@ -1,14 +0,0 @@
$FreeBSD$
--- src/libFLAC/include/private/md5.h.orig
+++ src/libFLAC/include/private/md5.h
@@ -41,7 +41,7 @@
FLAC__uint32 bytes[2];
FLAC__uint32 in[16];
FLAC__byte *internal_buf;
- unsigned capacity;
+ size_t capacity;
};
FLAC_API void FLAC__MD5Init(struct FLAC__MD5Context *context);

View File

@ -1,35 +0,0 @@
$FreeBSD$
--- src/libFLAC/md5.c.orig
+++ src/libFLAC/md5.c
@@ -31,6 +31,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#include "share/alloc.h"
#ifndef FLaC__INLINE
#define FLaC__INLINE
@@ -230,13 +231,19 @@
unsigned channel, sample, a_byte;
FLAC__int32 a_word;
FLAC__byte *buf_;
- const unsigned bytes_needed = channels * samples * bytes_per_sample;
+ const size_t bytes_needed = (size_t)channels * (size_t)samples * (size_t)bytes_per_sample;
+
+ /* overflow check */
+ if((size_t)channels > SIZE_MAX / (size_t)bytes_per_sample)
+ return false;
+ if((size_t)channels * (size_t)bytes_per_sample > SIZE_MAX / (size_t)samples)
+ return false;
if(ctx->capacity < bytes_needed) {
FLAC__byte *tmp = (FLAC__byte*)realloc(ctx->internal_buf, bytes_needed);
if(0 == tmp) {
free(ctx->internal_buf);
- if(0 == (ctx->internal_buf = (FLAC__byte*)malloc(bytes_needed)))
+ if(0 == (ctx->internal_buf = (FLAC__byte*)safe_malloc_(bytes_needed)))
return false;
}
ctx->internal_buf = tmp;

View File

@ -1,76 +0,0 @@
$FreeBSD$
--- src/libFLAC/memory.c.orig
+++ src/libFLAC/memory.c
@@ -35,6 +35,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#include "share/alloc.h"
void *FLAC__memory_alloc_aligned(size_t bytes, void **aligned_address)
{
@@ -44,10 +45,10 @@
#ifdef FLAC__ALIGN_MALLOC_DATA
/* align on 32-byte (256-bit) boundary */
- x = malloc(bytes+31);
+ x = safe_malloc_add_2op_(bytes, /*+*/31);
*aligned_address = (void*)(((unsigned)x + 31) & -32);
#else
- x = malloc(bytes);
+ x = safe_malloc_(bytes);
*aligned_address = x;
#endif
return x;
@@ -66,6 +67,9 @@
FLAC__ASSERT(0 != aligned_pointer);
FLAC__ASSERT(unaligned_pointer != aligned_pointer);
+ if((size_t)elements > SIZE_MAX / sizeof(*pu)) /* overflow check */
+ return false;
+
pu = (FLAC__int32*)FLAC__memory_alloc_aligned(sizeof(FLAC__int32) * elements, &u.pv);
if(0 == pu) {
return false;
@@ -92,6 +96,9 @@
FLAC__ASSERT(0 != aligned_pointer);
FLAC__ASSERT(unaligned_pointer != aligned_pointer);
+ if((size_t)elements > SIZE_MAX / sizeof(*pu)) /* overflow check */
+ return false;
+
pu = (FLAC__uint32*)FLAC__memory_alloc_aligned(sizeof(FLAC__uint32) * elements, &u.pv);
if(0 == pu) {
return false;
@@ -118,6 +125,9 @@
FLAC__ASSERT(0 != aligned_pointer);
FLAC__ASSERT(unaligned_pointer != aligned_pointer);
+ if((size_t)elements > SIZE_MAX / sizeof(*pu)) /* overflow check */
+ return false;
+
pu = (FLAC__uint64*)FLAC__memory_alloc_aligned(sizeof(FLAC__uint64) * elements, &u.pv);
if(0 == pu) {
return false;
@@ -144,6 +154,9 @@
FLAC__ASSERT(0 != aligned_pointer);
FLAC__ASSERT(unaligned_pointer != aligned_pointer);
+ if((size_t)elements > SIZE_MAX / sizeof(*pu)) /* overflow check */
+ return false;
+
pu = (unsigned*)FLAC__memory_alloc_aligned(sizeof(unsigned) * elements, &u.pv);
if(0 == pu) {
return false;
@@ -171,6 +184,9 @@
FLAC__ASSERT(0 != unaligned_pointer);
FLAC__ASSERT(0 != aligned_pointer);
FLAC__ASSERT(unaligned_pointer != aligned_pointer);
+
+ if((size_t)elements > SIZE_MAX / sizeof(*pu)) /* overflow check */
+ return false;
pu = (FLAC__real*)FLAC__memory_alloc_aligned(sizeof(FLAC__real) * elements, &u.pv);
if(0 == pu) {

View File

@ -1,67 +0,0 @@
$FreeBSD$
--- src/libFLAC/metadata_iterators.c.orig
+++ src/libFLAC/metadata_iterators.c
@@ -48,6 +48,7 @@
#include "FLAC/assert.h"
#include "FLAC/file_decoder.h"
+#include "share/alloc.h"
#ifdef max
#undef max
@@ -1928,7 +1929,7 @@
block->data = 0;
}
else {
- if(0 == (block->data = (FLAC__byte*)malloc(block_length)))
+ if(0 == (block->data = (FLAC__byte*)safe_malloc_(block_length)))
return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR;
if(read_cb(block->data, 1, block_length, handle) != block_length)
@@ -1949,7 +1950,7 @@
if(block->num_points == 0)
block->points = 0;
- else if(0 == (block->points = (FLAC__StreamMetadata_SeekPoint*)malloc(block->num_points * sizeof(FLAC__StreamMetadata_SeekPoint))))
+ else if(0 == (block->points = (FLAC__StreamMetadata_SeekPoint*)safe_malloc_mul_2op_(block->num_points, /*times*/ sizeof(FLAC__StreamMetadata_SeekPoint))))
return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR;
for(i = 0; i < block->num_points; i++) {
@@ -1982,7 +1983,7 @@
entry->entry = 0;
}
else {
- if(0 == (entry->entry = (FLAC__byte*)malloc(entry->length+1)))
+ if(0 == (entry->entry = (FLAC__byte*)safe_malloc_add_2op_(entry->length, /*+*/1)))
return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR;
if(read_cb(entry->entry, 1, entry->length, handle) != entry->length)
@@ -2145,7 +2146,7 @@
block->data = 0;
}
else {
- if(0 == (block->data = (FLAC__byte*)malloc(block_length)))
+ if(0 == (block->data = (FLAC__byte*)safe_malloc_(block_length)))
return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR;
if(read_cb(block->data, 1, block_length, handle) != block_length)
@@ -2812,7 +2813,7 @@
{
static const char *tempfile_suffix = ".metadata_edit";
if(0 == tempfile_path_prefix) {
- if(0 == (*tempfilename = (char*)malloc(strlen(filename) + strlen(tempfile_suffix) + 1))) {
+ if(0 == (*tempfilename = (char*)safe_malloc_add_3op_(strlen(filename), /*+*/strlen(tempfile_suffix), /*+*/1))) {
*status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR;
return false;
}
@@ -2826,7 +2827,7 @@
else
p++;
- if(0 == (*tempfilename = (char*)malloc(strlen(tempfile_path_prefix) + 1 + strlen(p) + strlen(tempfile_suffix) + 1))) {
+ if(0 == (*tempfilename = (char*)safe_malloc_add_4op_(strlen(tempfile_path_prefix), /*+*/strlen(p), /*+*/strlen(tempfile_suffix), /*+*/2))) {
*status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR;
return false;
}

View File

@ -1,176 +0,0 @@
$FreeBSD$
--- src/libFLAC/metadata_object.c.orig
+++ src/libFLAC/metadata_object.c
@@ -35,6 +35,7 @@
#include "private/metadata.h"
#include "FLAC/assert.h"
+#include "share/alloc.h"
/****************************************************************************
@@ -47,7 +48,7 @@
{
if(bytes > 0 && 0 != from) {
FLAC__byte *x;
- if(0 == (x = (FLAC__byte*)malloc(bytes)))
+ if(0 == (x = (FLAC__byte*)safe_malloc_(bytes)))
return false;
memcpy(x, from, bytes);
*to = x;
@@ -62,7 +63,7 @@
static FLAC__bool ensure_null_terminated_(FLAC__byte **entry, unsigned length)
{
- FLAC__byte *x = (FLAC__byte*)realloc(*entry, length+1);
+ FLAC__byte *x = (FLAC__byte*)safe_realloc_add_2op_(*entry, length, /*+*/1);
if(0 != x) {
x[length] = '\0';
*entry = x;
@@ -82,7 +83,7 @@
else {
FLAC__byte *x;
FLAC__ASSERT(from->length > 0);
- if(0 == (x = (FLAC__byte*)malloc(from->length+1)))
+ if(0 == (x = (FLAC__byte*)safe_malloc_add_2op_(from->length, /*+*/1)))
return false;
memcpy(x, from->entry, from->length);
x[from->length] = '\0';
@@ -100,7 +101,7 @@
else {
FLAC__StreamMetadata_CueSheet_Index *x;
FLAC__ASSERT(from->num_indices > 0);
- if(0 == (x = (FLAC__StreamMetadata_CueSheet_Index*)malloc(from->num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index))))
+ if(0 == (x = (FLAC__StreamMetadata_CueSheet_Index*)safe_malloc_mul_2op_(from->num_indices, /*times*/sizeof(FLAC__StreamMetadata_CueSheet_Index))))
return false;
memcpy(x, from->indices, from->num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index));
to->indices = x;
@@ -122,7 +123,7 @@
FLAC__ASSERT(num_points > 0);
- object_array = (FLAC__StreamMetadata_SeekPoint*)malloc(num_points * sizeof(FLAC__StreamMetadata_SeekPoint));
+ object_array = (FLAC__StreamMetadata_SeekPoint*)safe_malloc_mul_2op_(num_points, /*times*/sizeof(FLAC__StreamMetadata_SeekPoint));
if(0 != object_array) {
unsigned i;
@@ -155,7 +156,7 @@
{
FLAC__ASSERT(num_comments > 0);
- return (FLAC__StreamMetadata_VorbisComment_Entry*)calloc(num_comments, sizeof(FLAC__StreamMetadata_VorbisComment_Entry));
+ return (FLAC__StreamMetadata_VorbisComment_Entry*)safe_calloc_(num_comments, sizeof(FLAC__StreamMetadata_VorbisComment_Entry));
}
static void vorbiscomment_entry_array_delete_(FLAC__StreamMetadata_VorbisComment_Entry *object_array, unsigned num_comments)
@@ -294,14 +295,14 @@
{
FLAC__ASSERT(num_indices > 0);
- return (FLAC__StreamMetadata_CueSheet_Index*)calloc(num_indices, sizeof(FLAC__StreamMetadata_CueSheet_Index));
+ return (FLAC__StreamMetadata_CueSheet_Index*)safe_calloc_(num_indices, sizeof(FLAC__StreamMetadata_CueSheet_Index));
}
static FLAC__StreamMetadata_CueSheet_Track *cuesheet_track_array_new_(unsigned num_tracks)
{
FLAC__ASSERT(num_tracks > 0);
- return (FLAC__StreamMetadata_CueSheet_Track*)calloc(num_tracks, sizeof(FLAC__StreamMetadata_CueSheet_Track));
+ return (FLAC__StreamMetadata_CueSheet_Track*)safe_calloc_(num_tracks, sizeof(FLAC__StreamMetadata_CueSheet_Track));
}
static void cuesheet_track_array_delete_(FLAC__StreamMetadata_CueSheet_Track *object_array, unsigned num_tracks)
@@ -462,6 +463,10 @@
break;
case FLAC__METADATA_TYPE_SEEKTABLE:
to->data.seek_table.num_points = object->data.seek_table.num_points;
+ if(to->data.seek_table.num_points > SIZE_MAX / sizeof(FLAC__StreamMetadata_SeekPoint)) { /* overflow check */
+ FLAC__metadata_object_delete(to);
+ return 0;
+ }
if(!copy_bytes_((FLAC__byte**)&to->data.seek_table.points, (FLAC__byte*)object->data.seek_table.points, object->data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint))) {
FLAC__metadata_object_delete(to);
return 0;
@@ -788,8 +793,12 @@
return false;
}
else {
- const unsigned old_size = object->data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint);
- const unsigned new_size = new_num_points * sizeof(FLAC__StreamMetadata_SeekPoint);
+ const size_t old_size = object->data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint);
+ const size_t new_size = new_num_points * sizeof(FLAC__StreamMetadata_SeekPoint);
+
+ /* overflow check */
+ if((size_t)new_num_points > SIZE_MAX / sizeof(FLAC__StreamMetadata_SeekPoint))
+ return false;
FLAC__ASSERT(object->data.seek_table.num_points > 0);
@@ -982,8 +991,12 @@
return false;
}
else {
- const unsigned old_size = object->data.vorbis_comment.num_comments * sizeof(FLAC__StreamMetadata_VorbisComment_Entry);
- const unsigned new_size = new_num_comments * sizeof(FLAC__StreamMetadata_VorbisComment_Entry);
+ const size_t old_size = object->data.vorbis_comment.num_comments * sizeof(FLAC__StreamMetadata_VorbisComment_Entry);
+ const size_t new_size = new_num_comments * sizeof(FLAC__StreamMetadata_VorbisComment_Entry);
+
+ /* overflow check */
+ if((size_t)new_num_comments > SIZE_MAX / sizeof(FLAC__StreamMetadata_VorbisComment_Entry))
+ return false;
FLAC__ASSERT(object->data.vorbis_comment.num_comments > 0);
@@ -1131,7 +1144,7 @@
const size_t nn = strlen(field_name);
const size_t nv = strlen(field_value);
entry->length = nn + 1 /*=*/ + nv;
- if(0 == (entry->entry = (FLAC__byte*)malloc(entry->length+1)))
+ if(0 == (entry->entry = (FLAC__byte*)safe_malloc_add_2op_(entry->length, /*+*/1)))
return false;
memcpy(entry->entry, field_name, nn);
entry->entry[nn] = '=';
@@ -1158,9 +1171,9 @@
FLAC__ASSERT(0 != eq);
if(0 == eq)
return false; /* double protection */
- if(0 == (*field_name = (char*)malloc(nn+1)))
+ if(0 == (*field_name = (char*)safe_malloc_add_2op_(nn, /*+*/1)))
return false;
- if(0 == (*field_value = (char*)malloc(nv+1))) {
+ if(0 == (*field_value = (char*)safe_malloc_add_2op_(nv, /*+*/1))) {
free(*field_name);
return false;
}
@@ -1290,8 +1303,12 @@
return false;
}
else {
- const unsigned old_size = track->num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index);
- const unsigned new_size = new_num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index);
+ const size_t old_size = track->num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index);
+ const size_t new_size = new_num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index);
+
+ /* overflow check */
+ if((size_t)new_num_indices > SIZE_MAX / sizeof(FLAC__StreamMetadata_CueSheet_Index))
+ return false;
FLAC__ASSERT(track->num_indices > 0);
@@ -1374,8 +1391,12 @@
return false;
}
else {
- const unsigned old_size = object->data.cue_sheet.num_tracks * sizeof(FLAC__StreamMetadata_CueSheet_Track);
- const unsigned new_size = new_num_tracks * sizeof(FLAC__StreamMetadata_CueSheet_Track);
+ const size_t old_size = object->data.cue_sheet.num_tracks * sizeof(FLAC__StreamMetadata_CueSheet_Track);
+ const size_t new_size = new_num_tracks * sizeof(FLAC__StreamMetadata_CueSheet_Track);
+
+ /* overflow check */
+ if((size_t)new_num_tracks > SIZE_MAX / sizeof(FLAC__StreamMetadata_CueSheet_Track))
+ return false;
FLAC__ASSERT(object->data.cue_sheet.num_tracks > 0);

View File

@ -1,121 +0,0 @@
$FreeBSD$
--- src/libFLAC/stream_decoder.c.orig
+++ src/libFLAC/stream_decoder.c
@@ -46,6 +46,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#include "share/alloc.h"
#ifdef max
#undef max
@@ -214,7 +215,7 @@
}
decoder->private_->metadata_filter_ids_capacity = 16;
- if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)malloc((FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) * decoder->private_->metadata_filter_ids_capacity))) {
+ if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)safe_malloc_mul_2op_((FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8), /*times*/decoder->private_->metadata_filter_ids_capacity))) {
FLAC__bitbuffer_delete(decoder->private_->input);
free(decoder->private_);
free(decoder->protected_);
@@ -455,7 +456,7 @@
FLAC__ASSERT(0 != decoder->private_->metadata_filter_ids);
if(decoder->private_->metadata_filter_ids_count == decoder->private_->metadata_filter_ids_capacity) {
- if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)realloc(decoder->private_->metadata_filter_ids, decoder->private_->metadata_filter_ids_capacity * 2)))
+ if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)safe_realloc_mul_2op_(decoder->private_->metadata_filter_ids, decoder->private_->metadata_filter_ids_capacity, /*times*/2)))
return decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
decoder->private_->metadata_filter_ids_capacity *= 2;
}
@@ -512,7 +513,7 @@
FLAC__ASSERT(0 != decoder->private_->metadata_filter_ids);
if(decoder->private_->metadata_filter_ids_count == decoder->private_->metadata_filter_ids_capacity) {
- if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)realloc(decoder->private_->metadata_filter_ids, decoder->private_->metadata_filter_ids_capacity * 2)))
+ if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)safe_realloc_mul_2op_(decoder->private_->metadata_filter_ids, decoder->private_->metadata_filter_ids_capacity, /*times*/2)))
return decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
decoder->private_->metadata_filter_ids_capacity *= 2;
}
@@ -804,7 +805,7 @@
* (at negative indices) for alignment purposes; we use 4
* to keep the data well-aligned.
*/
- tmp = (FLAC__int32*)malloc(sizeof(FLAC__int32)*(size+4));
+ tmp = (FLAC__int32*)safe_malloc_mul_2op_(sizeof(FLAC__int32), /*times*/(size+4));
if(tmp == 0) {
decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
return false;
@@ -967,7 +968,7 @@
case FLAC__METADATA_TYPE_APPLICATION:
/* remember, we read the ID already */
if(real_length > 0) {
- if(0 == (block.data.application.data = (FLAC__byte*)malloc(real_length))) {
+ if(0 == (block.data.application.data = (FLAC__byte*)safe_malloc_(real_length))) {
decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
return false;
}
@@ -991,7 +992,7 @@
break;
default:
if(real_length > 0) {
- if(0 == (block.data.unknown.data = (FLAC__byte*)malloc(real_length))) {
+ if(0 == (block.data.unknown.data = (FLAC__byte*)safe_malloc_(real_length))) {
decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
return false;
}
@@ -1132,7 +1133,7 @@
decoder->private_->seek_table.data.seek_table.num_points = length / FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
/* use realloc since we may pass through here several times (e.g. after seeking) */
- if(0 == (decoder->private_->seek_table.data.seek_table.points = (FLAC__StreamMetadata_SeekPoint*)realloc(decoder->private_->seek_table.data.seek_table.points, decoder->private_->seek_table.data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint)))) {
+ if(0 == (decoder->private_->seek_table.data.seek_table.points = (FLAC__StreamMetadata_SeekPoint*)safe_realloc_mul_2op_(decoder->private_->seek_table.data.seek_table.points, decoder->private_->seek_table.data.seek_table.num_points, /*times*/sizeof(FLAC__StreamMetadata_SeekPoint)))) {
decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
return false;
}
@@ -1171,7 +1172,7 @@
if(!FLAC__bitbuffer_read_raw_uint32_little_endian(decoder->private_->input, &obj->vendor_string.length, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */
if(obj->vendor_string.length > 0) {
- if(0 == (obj->vendor_string.entry = (FLAC__byte*)malloc(obj->vendor_string.length+1))) {
+ if(0 == (obj->vendor_string.entry = (FLAC__byte*)safe_malloc_add_2op_(obj->vendor_string.length, /*+*/1))) {
decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
return false;
}
@@ -1189,7 +1190,7 @@
/* read comments */
if(obj->num_comments > 0) {
- if(0 == (obj->comments = (FLAC__StreamMetadata_VorbisComment_Entry*)malloc(obj->num_comments * sizeof(FLAC__StreamMetadata_VorbisComment_Entry)))) {
+ if(0 == (obj->comments = (FLAC__StreamMetadata_VorbisComment_Entry*)safe_malloc_mul_2op_(obj->num_comments, /*times*/sizeof(FLAC__StreamMetadata_VorbisComment_Entry)))) {
decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
return false;
}
@@ -1198,7 +1199,7 @@
if(!FLAC__bitbuffer_read_raw_uint32_little_endian(decoder->private_->input, &obj->comments[i].length, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */
if(obj->comments[i].length > 0) {
- if(0 == (obj->comments[i].entry = (FLAC__byte*)malloc(obj->comments[i].length+1))) {
+ if(0 == (obj->comments[i].entry = (FLAC__byte*)safe_malloc_add_2op_(obj->comments[i].length, /*+*/1))) {
decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
return false;
}
@@ -1244,7 +1245,7 @@
obj->num_tracks = x;
if(obj->num_tracks > 0) {
- if(0 == (obj->tracks = (FLAC__StreamMetadata_CueSheet_Track*)calloc(obj->num_tracks, sizeof(FLAC__StreamMetadata_CueSheet_Track)))) {
+ if(0 == (obj->tracks = (FLAC__StreamMetadata_CueSheet_Track*)safe_calloc_(obj->num_tracks, sizeof(FLAC__StreamMetadata_CueSheet_Track)))) {
decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
return false;
}
@@ -1277,7 +1278,7 @@
track->num_indices = (FLAC__byte)x;
if(track->num_indices > 0) {
- if(0 == (track->indices = (FLAC__StreamMetadata_CueSheet_Index*)calloc(track->num_indices, sizeof(FLAC__StreamMetadata_CueSheet_Index)))) {
+ if(0 == (track->indices = (FLAC__StreamMetadata_CueSheet_Index*)safe_calloc_(track->num_indices, sizeof(FLAC__StreamMetadata_CueSheet_Index)))) {
decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
return false;
}

View File

@ -1,22 +0,0 @@
$FreeBSD$
--- src/libFLAC/stream_encoder.c.orig
+++ src/libFLAC/stream_encoder.c
@@ -50,6 +50,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#include "share/alloc.h"
#ifdef min
#undef min
@@ -836,7 +837,7 @@
*/
encoder->private_->verify.input_fifo.size = encoder->protected_->blocksize;
for(i = 0; i < encoder->protected_->channels; i++) {
- if(0 == (encoder->private_->verify.input_fifo.data[i] = (FLAC__int32*)malloc(sizeof(FLAC__int32) * encoder->private_->verify.input_fifo.size)))
+ if(0 == (encoder->private_->verify.input_fifo.data[i] = (FLAC__int32*)safe_malloc_mul_2op_(sizeof(FLAC__int32), /*times*/encoder->private_->verify.input_fifo.size)))
return encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR;
}
encoder->private_->verify.input_fifo.tail = 0;

View File

@ -1,22 +0,0 @@
$FreeBSD$
--- src/libOggFLAC/file_decoder.c.orig
+++ src/libOggFLAC/file_decoder.c
@@ -43,6 +43,7 @@
#include "FLAC/assert.h"
#include "protected/file_decoder.h"
#include "protected/seekable_stream_decoder.h"
+#include "share/alloc.h"
/***********************************************************************
*
@@ -248,7 +249,7 @@
decoder->private_->filename = 0;
}
if(0 != strcmp(value, "-")) {
- if(0 == (decoder->private_->filename = (char*)malloc(strlen(value)+1))) {
+ if(0 == (decoder->private_->filename = (char*)safe_malloc_add_2op_(strlen(value), /*+*/1))) {
decoder->protected_->state = OggFLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR;
return false;
}

View File

@ -1,22 +0,0 @@
$FreeBSD$
--- src/libOggFLAC/file_encoder.c.orig
+++ src/libOggFLAC/file_encoder.c
@@ -35,6 +35,7 @@
#include "FLAC/assert.h"
#include "OggFLAC/seekable_stream_encoder.h"
#include "protected/file_encoder.h"
+#include "share/alloc.h"
#ifdef max
#undef max
@@ -450,7 +451,7 @@
free(encoder->private_->filename);
encoder->private_->filename = 0;
}
- if(0 == (encoder->private_->filename = (char*)malloc(strlen(value)+1))) {
+ if(0 == (encoder->private_->filename = (char*)safe_malloc_add_2op_(strlen(value), /*+*/1))) {
encoder->protected_->state = OggFLAC__FILE_ENCODER_MEMORY_ALLOCATION_ERROR;
return false;
}

View File

@ -1,31 +0,0 @@
$FreeBSD$
--- src/libOggFLAC/ogg_helper.c.orig
+++ src/libOggFLAC/ogg_helper.c
@@ -34,6 +34,7 @@
#include "FLAC/assert.h"
#include "private/ogg_helper.h"
#include "protected/seekable_stream_encoder.h"
+#include "share/alloc.h"
static FLAC__bool full_read_(OggFLAC__SeekableStreamEncoder *encoder, FLAC__byte *buffer, unsigned bytes, OggFLAC__SeekableStreamEncoderReadCallback read_callback, void *client_data)
@@ -102,7 +103,7 @@
}
/* allocate space for the page header */
- if(0 == (page->header = (unsigned char *)malloc(OGG_MAX_HEADER_LEN))) {
+ if(0 == (page->header = (unsigned char *)safe_malloc_(OGG_MAX_HEADER_LEN))) {
encoder->protected_->state = OggFLAC__SEEKABLE_STREAM_ENCODER_MEMORY_ALLOCATION_ERROR;
return false;
}
@@ -144,7 +145,7 @@
}
/* allocate space for the page body */
- if(0 == (page->body = (unsigned char *)malloc(page->body_len))) {
+ if(0 == (page->body = (unsigned char *)safe_malloc_(page->body_len))) {
encoder->protected_->state = OggFLAC__SEEKABLE_STREAM_ENCODER_MEMORY_ALLOCATION_ERROR;
return false;
}

View File

@ -1,24 +0,0 @@
$FreeBSD$
--- src/metaflac/operations.c.orig
+++ src/metaflac/operations.c
@@ -21,6 +21,7 @@
#include "utils.h"
#include "FLAC/assert.h"
#include "FLAC/metadata.h"
+#include "share/alloc.h"
#include "share/grabbag.h"
#include <stdio.h>
#include <stdlib.h>
@@ -430,8 +431,8 @@
}
if(
- 0 == (title_gains = (float*)malloc(sizeof(float) * num_files)) ||
- 0 == (title_peaks = (float*)malloc(sizeof(float) * num_files))
+ 0 == (title_gains = (float*)safe_malloc_mul_2op_(sizeof(float), /*times*/num_files)) ||
+ 0 == (title_peaks = (float*)safe_malloc_mul_2op_(sizeof(float), /*times*/num_files))
)
die("out of memory allocating space for title gains/peaks");

View File

@ -1,66 +0,0 @@
$FreeBSD$
--- src/metaflac/options.c.orig
+++ src/metaflac/options.c
@@ -20,6 +20,7 @@
#include "usage.h"
#include "utils.h"
#include "FLAC/assert.h"
+#include "share/alloc.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -183,7 +184,7 @@
if(options->num_files > 0) {
unsigned i = 0;
- if(0 == (options->filenames = (char**)malloc(sizeof(char*) * options->num_files)))
+ if(0 == (options->filenames = (char**)safe_malloc_mul_2op_(sizeof(char*), /*times*/options->num_files)))
die("out of memory allocating space for file names list");
while(share__optind < argc)
options->filenames[i++] = local_strdup(argv[share__optind++]);
@@ -661,8 +662,10 @@
}
if(options->ops.capacity <= options->ops.num_operations) {
unsigned original_capacity = options->ops.capacity;
- options->ops.capacity *= 4;
- if(0 == (options->ops.operations = (Operation*)realloc(options->ops.operations, sizeof(Operation) * options->ops.capacity)))
+ if(options->ops.capacity > SIZE_MAX / 2) /* overflow check */
+ die("out of memory allocating space for option list");
+ options->ops.capacity *= 2;
+ if(0 == (options->ops.operations = (Operation*)safe_realloc_mul_2op_(options->ops.operations, sizeof(Operation), /*times*/options->ops.capacity)))
die("out of memory allocating space for option list");
memset(options->ops.operations + original_capacity, 0, sizeof(Operation) * (options->ops.capacity - original_capacity));
}
@@ -680,8 +683,10 @@
}
if(options->args.capacity <= options->args.num_arguments) {
unsigned original_capacity = options->args.capacity;
- options->args.capacity *= 4;
- if(0 == (options->args.arguments = (Argument*)realloc(options->args.arguments, sizeof(Argument) * options->args.capacity)))
+ if(options->args.capacity > SIZE_MAX / 2) /* overflow check */
+ die("out of memory allocating space for option list");
+ options->args.capacity *= 2;
+ if(0 == (options->args.arguments = (Argument*)safe_realloc_mul_2op_(options->args.arguments, sizeof(Argument), /*times*/options->args.capacity)))
die("out of memory allocating space for option list");
memset(options->args.arguments + original_capacity, 0, sizeof(Argument) * (options->args.capacity - original_capacity));
}
@@ -897,7 +902,7 @@
/* make space */
FLAC__ASSERT(out->num_entries > 0);
- if(0 == (out->entries = (unsigned*)malloc(sizeof(unsigned) * out->num_entries)))
+ if(0 == (out->entries = (unsigned*)safe_malloc_mul_2op_(sizeof(unsigned), /*times*/out->num_entries)))
die("out of memory allocating space for option list");
/* load 'em up */
@@ -936,7 +941,7 @@
/* make space */
FLAC__ASSERT(out->num_entries > 0);
- if(0 == (out->entries = (Argument_BlockTypeEntry*)malloc(sizeof(Argument_BlockTypeEntry) * out->num_entries)))
+ if(0 == (out->entries = (Argument_BlockTypeEntry*)safe_malloc_mul_2op_(sizeof(Argument_BlockTypeEntry), /*times*/out->num_entries)))
die("out of memory allocating space for option list");
/* load 'em up */

View File

@ -1,22 +0,0 @@
$FreeBSD$
--- src/metaflac/utils.c.orig
+++ src/metaflac/utils.c
@@ -18,6 +18,7 @@
#include "utils.h"
#include "FLAC/assert.h"
+#include "share/alloc.h"
#include "share/utf8.h"
#include <ctype.h>
#include <stdarg.h>
@@ -64,7 +65,7 @@
if(nsource == 0)
return;
- *dest = (char*)realloc(*dest, ndest + nsource + 1);
+ *dest = (char*)safe_realloc_add_3op_(*dest, ndest, /*+*/nsource, /*+*/1);
if(0 == *dest)
die("out of memory growing string");
strcpy((*dest)+ndest, source);

View File

@ -1,25 +0,0 @@
$FreeBSD$
--- src/plugin_common/charset.c.orig
+++ src/plugin_common/charset.c
@@ -83,6 +83,8 @@
/* Due to a GLIBC bug, round outbuf_size up to a multiple of 4 */
/* + 1 for nul in case len == 1 */
outsize = ((length + 3) & ~3) + 1;
+ if(outsize < length) /* overflow check */
+ return NULL;
out = (char*)malloc(outsize);
outleft = outsize - 1;
outptr = out;
@@ -95,6 +97,10 @@
{
case E2BIG:
used = outptr - out;
+ if((outsize - 1) * 2 + 1 <= outsize) { /* overflow check */
+ free(out);
+ return NULL;
+ }
outsize = (outsize - 1) * 2 + 1;
out = realloc(out, outsize);
outptr = out + used;

View File

@ -1,59 +0,0 @@
$FreeBSD$
--- src/plugin_common/tags.c.orig
+++ src/plugin_common/tags.c
@@ -23,6 +23,7 @@
#include "tags.h"
#include "FLAC/assert.h"
#include "FLAC/metadata.h"
+#include "share/alloc.h"
static __inline unsigned local__wide_strlen(const FLAC__uint16 *s)
@@ -82,7 +83,7 @@
}
/* allocate */
- out = (FLAC__uint16*)malloc(chars * sizeof(FLAC__uint16));
+ out = (FLAC__uint16*)safe_malloc_mul_2op_(chars, /*times*/sizeof(FLAC__uint16));
if (0 == out) {
FLAC__ASSERT(0);
return 0;
@@ -130,19 +131,23 @@
static char *local__convert_ucs2_to_utf8(const FLAC__uint16 *src, unsigned length)
{
char *out;
- unsigned len = 0;
+ unsigned len = 0, n;
FLAC__ASSERT(0 != src);
/* calculate length */
{
unsigned i;
- for (i = 0; i < length; i++)
- len += local__ucs2len(src[i]);
+ for (i = 0; i < length; i++) {
+ n += local__ucs2len(src[i]);
+ if(len + n < len) /* overflow check */
+ return 0;
+ len += n;
+ }
}
/* allocate */
- out = (char*)malloc(len * sizeof(char));
+ out = (char*)safe_malloc_mul_2op_(len, /*times*/sizeof(char));
if (0 == out)
return 0;
@@ -265,7 +270,7 @@
const size_t value_len = strlen(value);
const size_t separator_len = strlen(separator);
FLAC__byte *new_entry;
- if(0 == (new_entry = (FLAC__byte*)realloc(entry->entry, entry->length + value_len + separator_len + 1)))
+ if(0 == (new_entry = (FLAC__byte*)safe_realloc_add_4op_(entry->entry, entry->length, /*+*/value_len, /*+*/separator_len, /*+*/1)))
return false;
memcpy(new_entry+entry->length, separator, separator_len);
entry->length += separator_len;

View File

@ -1,22 +0,0 @@
$FreeBSD$
--- src/share/utf8/charset.c.orig
+++ src/share/utf8/charset.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
+#include "share/alloc.h"
#include "charset.h"
#include "charmaps.h"
@@ -492,7 +493,7 @@
if (!charset1 || !charset2 )
return -1;
- tobuf = (char *)malloc(fromlen * charset2->max + 1);
+ tobuf = (char *)safe_malloc_mul2add_(fromlen, /*times*/charset2->max, /*+*/1);
if (!tobuf)
return -2;

View File

@ -1,49 +0,0 @@
$FreeBSD$
--- src/share/utf8/iconvert.c.orig
+++ src/share/utf8/iconvert.c
@@ -27,6 +27,7 @@
#include <iconv.h>
#include <stdlib.h>
#include <string.h>
+#include "share/alloc.h"
/*
* Convert data from one encoding to another. Return:
@@ -79,7 +80,7 @@
* This is deliberately not a config option as people often
* change their iconv library without rebuilding applications.
*/
- tocode1 = (char *)malloc(strlen(tocode) + 11);
+ tocode1 = (char *)safe_malloc_add_2op_(strlen(tocode), /*+*/11);
if (!tocode1)
goto fail;
@@ -117,6 +118,8 @@
break;
if (obl < 6) {
/* Enlarge the buffer */
+ if(utflen*2 < utflen) /* overflow check */
+ goto fail;
utflen *= 2;
newbuf = (char *)realloc(utfbuf, utflen);
if (!newbuf)
@@ -143,7 +146,7 @@
iconv_close(cd1);
return ret;
}
- newbuf = (char *)realloc(utfbuf, (ob - utfbuf) + 1);
+ newbuf = (char *)safe_realloc_add_2op_(utfbuf, (ob - utfbuf), /*+*/1);
if (!newbuf)
goto fail;
ob = (ob - utfbuf) + newbuf;
@@ -194,7 +197,7 @@
outlen += ob - tbuf;
/* Convert from UTF-8 for real */
- outbuf = (char *)malloc(outlen + 1);
+ outbuf = (char *)safe_malloc_add_2op_(outlen, /*+*/1);
if (!outbuf)
goto fail;
ib = utfbuf;

View File

@ -1,72 +0,0 @@
$FreeBSD$
--- src/share/utf8/utf8.c.orig
+++ src/share/utf8/utf8.c
@@ -28,6 +28,7 @@
#include <config.h>
#endif
+#include "share/alloc.h"
#include "utf8.h"
#include "charset.h"
@@ -57,10 +58,13 @@
} else {
size += 3;
}
+ if(size+n < size) /* overflow check */
+ return NULL;
+ size += n;
c = unicode[index++];
}
- out = malloc(size + 1);
+ out = safe_malloc_add_2op_(size, /*+*/1);
if (out == NULL)
return NULL;
index = 0;
@@ -101,11 +105,15 @@
} else {
index += 1;
}
+ if(size + 1 == 0) /* overflow check */
+ return NULL;
size += 1;
c = utf8[index++];
}
- out = malloc((size + 1) * sizeof(wchar_t));
+ if(size + 1 == 0) /* overflow check */
+ return NULL;
+ out = safe_malloc_mul_2op_((size + 1), /*times*/sizeof(wchar_t));
if (out == NULL)
return NULL;
index = 0;
@@ -147,7 +155,7 @@
return -1;
}
- unicode = calloc(wchars + 1, sizeof(unsigned short));
+ unicode = safe_calloc_(wchars + 1, sizeof(unsigned short));
if(unicode == NULL)
{
fprintf(stderr, "Out of memory processing string to UTF8\n");
@@ -197,7 +205,7 @@
return -1;
}
- *to = calloc(chars + 1, sizeof(unsigned char));
+ *to = safe_calloc_(chars + 1, sizeof(unsigned char));
if(*to == NULL)
{
fprintf(stderr, "Out of memory processing string to local charset\n");
@@ -285,7 +293,7 @@
if (ret != -1)
return ret;
- s = malloc(fromlen + 1);
+ s = safe_malloc_add_2op_(fromlen, /*+*/1);
if (!s)
return -1;
strcpy(s, from);

View File

@ -2,10 +2,8 @@ FLAC is an Open Source lossless audio codec.
FLAC is comprised of
* libFLAC, a library which implements reference encoders and
decoders, and a metadata interface
decoders for native FLAC and Ogg FLAC, and a metadata interface
* libFLAC++, a C++ object wrapper library around libFLAC
* libOggFLAC and libOggFLAC++, which provide encoders and
decoders for FLAC streams in an Ogg container
* flac, a command-line program for encoding and decoding files
* metaflac, a command-line program for viewing and editing FLAC
metadata

View File

@ -10,218 +10,161 @@ include/FLAC/all.h
include/FLAC/assert.h
include/FLAC/callback.h
include/FLAC/export.h
include/FLAC/file_decoder.h
include/FLAC/file_encoder.h
include/FLAC/format.h
include/FLAC/metadata.h
include/FLAC/ordinals.h
include/FLAC/seekable_stream_decoder.h
include/FLAC/seekable_stream_encoder.h
include/FLAC/stream_decoder.h
include/FLAC/stream_encoder.h
include/OggFLAC++/all.h
include/OggFLAC++/decoder.h
include/OggFLAC++/encoder.h
include/OggFLAC++/export.h
include/OggFLAC/all.h
include/OggFLAC/export.h
include/OggFLAC/file_decoder.h
include/OggFLAC/file_encoder.h
include/OggFLAC/seekable_stream_decoder.h
include/OggFLAC/seekable_stream_encoder.h
include/OggFLAC/stream_decoder.h
include/OggFLAC/stream_encoder.h
lib/libFLAC++.a
lib/libFLAC++.la
lib/libFLAC++.so
lib/libFLAC++.so.5
lib/libFLAC++.so.8
lib/libFLAC.a
lib/libFLAC.la
lib/libFLAC.so
lib/libFLAC.so.7
lib/libOggFLAC++.a
lib/libOggFLAC++.la
lib/libOggFLAC++.so
lib/libOggFLAC++.so.2
lib/libOggFLAC.a
lib/libOggFLAC.la
lib/libOggFLAC.so
lib/libOggFLAC.so.3
lib/libFLAC.so.10
libdata/pkgconfig/flac++.pc
libdata/pkgconfig/flac.pc
share/aclocal/libFLAC++.m4
share/aclocal/libFLAC.m4
share/aclocal/libOggFLAC++.m4
share/aclocal/libOggFLAC.m4
%%PORTDOCS%%%%DOCSDIR%%/FLAC.tag
%%PORTDOCS%%%%DOCSDIR%%/html/api/+_2all_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/+_2export_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/+_2export_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/+_2metadata_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/+_2metadata_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC++_2all_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC++_2decoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC++_2decoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC++_2encoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC++_2encoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC++_2export_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC_2all_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC_2export_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC_2file__encoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC_2file__encoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC_2seekable__stream__encoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC_2seekable__stream__encoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC_2stream__decoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC_2stream__decoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC_2stream__encoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/FLAC_2stream__encoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC++_2all_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC++_2decoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC++_2decoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC++_2encoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC++_2encoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC++_2export_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC_2all_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC_2export_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC_2file__encoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC_2file__encoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC_2seekable__stream__encoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC_2seekable__stream__encoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC_2stream__decoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC_2stream__decoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC_2stream__encoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/OggFLAC_2stream__encoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/all_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/annotated.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/assert_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/callback_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/callback_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Decoder_1_1File-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Decoder_1_1File.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Decoder_1_1SeekableStream-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Decoder_1_1SeekableStream.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Decoder_1_1File.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Decoder_1_1Stream-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Decoder_1_1Stream.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Decoder_1_1Stream.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Decoder_1_1Stream_1_1State-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Decoder_1_1Stream_1_1State.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Encoder_1_1File-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Encoder_1_1File.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Encoder_1_1SeekableStream-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Encoder_1_1SeekableStream.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Encoder_1_1File.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Encoder_1_1Stream-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Encoder_1_1Stream.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Encoder_1_1Stream.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Encoder_1_1Stream_1_1State-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Encoder_1_1Stream_1_1State.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Application-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Application.gif
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Application.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Application.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Chain-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Chain.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Chain_1_1Status-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Chain_1_1Status.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1CueSheet-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1CueSheet.gif
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1CueSheet.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1CueSheet.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1CueSheet_1_1Track-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1CueSheet_1_1Track.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Iterator-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Iterator.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Padding-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Padding.gif
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Padding.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Padding.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Picture-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Picture.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Picture.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Prototype-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Prototype.gif
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Prototype.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Prototype.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1SeekTable-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1SeekTable.gif
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1SeekTable.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1SeekTable.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1SimpleIterator-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1SimpleIterator.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1SimpleIterator_1_1Status-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1SimpleIterator_1_1Status.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1StreamInfo-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1StreamInfo.gif
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1StreamInfo.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1StreamInfo.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Unknown-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Unknown.gif
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Unknown.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1Unknown.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1VorbisComment-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1VorbisComment.gif
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1VorbisComment.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1VorbisComment.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1VorbisComment_1_1Entry-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classFLAC_1_1Metadata_1_1VorbisComment_1_1Entry.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Decoder_1_1File-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Decoder_1_1File.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Decoder_1_1SeekableStream-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Decoder_1_1SeekableStream.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Decoder_1_1Stream-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Decoder_1_1Stream.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Encoder_1_1File-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Encoder_1_1File.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Encoder_1_1SeekableStream-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Encoder_1_1SeekableStream.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Encoder_1_1Stream-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classOggFLAC_1_1Encoder_1_1Stream.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/classes.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/decoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/decoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/dir_000000.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/dir_000001.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/dir_000002.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/dirs.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/doxygen.css
%%PORTDOCS%%%%DOCSDIR%%/html/api/doxygen.gif
%%PORTDOCS%%%%DOCSDIR%%/html/api/file__decoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/file__decoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/doxygen.png
%%PORTDOCS%%%%DOCSDIR%%/html/api/encoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/encoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/export_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/export_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/files.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/format_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/format_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/functions.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/functions_func.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/functions_vars.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/globals.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/globals_0x66.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/globals_0x67.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/globals_defs.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/globals_enum.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/globals_eval.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/globals_func.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/globals_type.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/globals_vars.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__callbacks.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__file__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__file__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__export.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__format.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__metadata.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__metadata__level0.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__metadata__level1.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__metadata__level2.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__metadata__object.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__seekable__stream__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__seekable__stream__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__stream__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flac__stream__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__file__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__file__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__export.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__metadata.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__metadata__level0.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__metadata__level1.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__metadata__level2.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__metadata__object.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__seekable__stream__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__seekable__stream__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__stream__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__flacpp__stream__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflac.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflac__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflac__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflac__file__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflac__seekable__stream__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflac__stream__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflac__stream__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflacpp.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflacpp__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflacpp__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflacpp__file__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflacpp__file__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflacpp__seekable__stream__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflacpp__seekable__stream__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflacpp__stream__decoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__oggflacpp__stream__encoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__porting.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__porting__1__1__2__to__1__1__3.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__porting__1__1__3__to__1__1__4.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/group__porting__1__1__4__to__1__2__0.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/hierarchy.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/index.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/metadata_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/metadata_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/modules.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/ordinals_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/seekable__stream__decoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/seekable__stream__decoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/stream__decoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/stream__decoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/stream__encoder_8h-source.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/stream__encoder_8h.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____EntropyCodingMethod-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____EntropyCodingMethod.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____EntropyCodingMethod__PartitionedRice-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____EntropyCodingMethod__PartitionedRice.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____EntropyCodingMethod__PartitionedRiceContents-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____EntropyCodingMethod__PartitionedRiceContents.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____FileDecoder-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____FileDecoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____FileEncoder-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____FileEncoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____Frame-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____Frame.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____FrameFooter-members.html
@ -230,10 +173,6 @@ share/aclocal/libOggFLAC.m4
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____FrameHeader.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____IOCallbacks-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____IOCallbacks.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____SeekableStreamDecoder-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____SeekableStreamDecoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____SeekableStreamEncoder-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____SeekableStreamEncoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____StreamDecoder-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____StreamDecoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____StreamEncoder-members.html
@ -250,6 +189,8 @@ share/aclocal/libOggFLAC.m4
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____StreamMetadata__CueSheet__Track.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____StreamMetadata__Padding-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____StreamMetadata__Padding.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____StreamMetadata__Picture-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____StreamMetadata__Picture.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____StreamMetadata__SeekPoint-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____StreamMetadata__SeekPoint.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____StreamMetadata__SeekTable-members.html
@ -272,30 +213,78 @@ share/aclocal/libOggFLAC.m4
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____Subframe__LPC.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____Subframe__Verbatim-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structFLAC____Subframe__Verbatim.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structOggFLAC____FileEncoder-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structOggFLAC____FileEncoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structOggFLAC____SeekableStreamEncoder-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structOggFLAC____SeekableStreamEncoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structOggFLAC____StreamDecoder-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structOggFLAC____StreamDecoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structOggFLAC____StreamEncoder-members.html
%%PORTDOCS%%%%DOCSDIR%%/html/api/structOggFLAC____StreamEncoder.html
%%PORTDOCS%%%%DOCSDIR%%/html/changelog.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__chopin_prelude_24.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__dream_theater_600.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__eddie_warner_titus.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__fanfare_de_l_eventail_de_jeanne.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__gloria_estefan_conga.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__hand_in_my_pocket.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__l_sub_raga_sivapriya.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__laetatus_sum.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__mummified_in_barbed_wire.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__prokofiev_pcon3_3.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__ravel_sq4_4.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__scarlatti_k42.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__tool_forty_six_and_2.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison__white_room.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison_all_cpudectime.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison_all_cpuenctime.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison_all_procdectime.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison_all_procenctime.html
%%PORTDOCS%%%%DOCSDIR%%/html/comparison_all_ratio.html
%%PORTDOCS%%%%DOCSDIR%%/html/developers.html
%%PORTDOCS%%%%DOCSDIR%%/html/documentation.html
%%PORTDOCS%%%%DOCSDIR%%/html/documentation_bugs.html
%%PORTDOCS%%%%DOCSDIR%%/html/documentation_example_code.html
%%PORTDOCS%%%%DOCSDIR%%/html/documentation_format_overview.html
%%PORTDOCS%%%%DOCSDIR%%/html/documentation_tasks.html
%%PORTDOCS%%%%DOCSDIR%%/html/documentation_tools.html
%%PORTDOCS%%%%DOCSDIR%%/html/documentation_tools_flac.html
%%PORTDOCS%%%%DOCSDIR%%/html/documentation_tools_metaflac.html
%%PORTDOCS%%%%DOCSDIR%%/html/documentation_tools_plugins.html
%%PORTDOCS%%%%DOCSDIR%%/html/download.html
%%PORTDOCS%%%%DOCSDIR%%/html/faq.html
%%PORTDOCS%%%%DOCSDIR%%/html/favicon.ico
%%PORTDOCS%%%%DOCSDIR%%/html/features.html
%%PORTDOCS%%%%DOCSDIR%%/html/flac.css
%%PORTDOCS%%%%DOCSDIR%%/html/format.html
%%PORTDOCS%%%%DOCSDIR%%/html/goals.html
%%PORTDOCS%%%%DOCSDIR%%/html/id.html
%%PORTDOCS%%%%DOCSDIR%%/html/images/1x1.gif
%%PORTDOCS%%%%DOCSDIR%%/html/images/cafebug.gif
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/Blackbird_Front_low3_325x87.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/MS300frontsmall_270x108.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/MediaBox_Frt_170x325.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/SB_Hero_Black_325x182.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/Sooloos-ControlOne_325x328.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/Z500_front_325x94.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/a2_01_325x252.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/arcus_325x135.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/bmp-1430_325x241.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/cs505_front_lrg_325x113.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/enus_3-4lft-hires_product_eva8000_325x127.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/escient_ProductLine_325x163.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/hifidelio_bl_front_Z_RGB_325x163.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/i-station-mini-dx_325x237.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/iwod-g10_325x257.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/knc_hr-2800_325x209.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/mediaready_prodmain_MRMCa_325x232.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/meizu_m6_325x206.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/musica_artwork_325x90.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/neodigits_x5000_325x124.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/onda-vx737_325x240.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/request_n_front_325x103.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/rio_karma_279x254.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/sonos_family_RGB_325x200.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/teclast-tl29_325x244.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/transporter_hero_grey_325x208.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/tvix-4000_325x204.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/hw/vibez_nofm_combi_black_b_325x220.jpg
%%PORTDOCS%%%%DOCSDIR%%/html/images/logo100.gif
%%PORTDOCS%%%%DOCSDIR%%/html/images/logo130.gif
%%PORTDOCS%%%%DOCSDIR%%/html/index.html
%%PORTDOCS%%%%DOCSDIR%%/html/itunes.html
%%PORTDOCS%%%%DOCSDIR%%/html/license.html
%%PORTDOCS%%%%DOCSDIR%%/html/links.html
%%PORTDOCS%%%%DOCSDIR%%/html/news.html
@ -313,11 +302,10 @@ share/aclocal/libOggFLAC.m4
%%PORTDOCS%%%%DOCSDIR%%/html/ru/links.html
%%PORTDOCS%%%%DOCSDIR%%/html/ru/news.html
%%PORTDOCS%%@dirrm %%DOCSDIR%%/html/ru
%%PORTDOCS%%@dirrm %%DOCSDIR%%/html/images/hw
%%PORTDOCS%%@dirrm %%DOCSDIR%%/html/images
%%PORTDOCS%%@dirrm %%DOCSDIR%%/html/api
%%PORTDOCS%%@dirrm %%DOCSDIR%%/html
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrm include/OggFLAC++
@dirrm include/OggFLAC
@dirrm include/FLAC++
@dirrm include/FLAC

View File

@ -7,6 +7,7 @@
PORTNAME= flac123
PORTVERSION= 0.0.11
PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= flac-tools
@ -14,7 +15,7 @@ MASTER_SITE_SUBDIR= flac-tools
MAINTAINER= multimedia@FreeBSD.org
COMMENT= Command-line player for flac audio files
LIB_DEPENDS= FLAC.7:${PORTSDIR}/audio/flac \
LIB_DEPENDS= FLAC.10:${PORTSDIR}/audio/flac \
ao.3:${PORTSDIR}/audio/libao \
popt.0:${PORTSDIR}/devel/popt

View File

@ -6,7 +6,7 @@
# $MCom: ports/audio/gstreamer-plugins-flac/Makefile,v 1.5 2008/03/19 14:05:29 ahze Exp $
#
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= audio
COMMENT= Gstreamer free lossless audio encoder/decoder plugin

View File

@ -7,6 +7,7 @@
PORTNAME= gtkpod
PORTVERSION= 0.99.12
PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@ -44,7 +45,7 @@ LIB_DEPENDS+= vorbis.4:${PORTSDIR}/audio/libvorbis
.endif
.if defined(WITH_FLAC) || exists(${LOCALBASE}/lib/libFLAC.so)
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
.endif
.if defined(WITH_GNOMEVFS) || ${HAVE_GNOME:Mgnomevfs2}

View File

@ -7,7 +7,7 @@
PORTNAME= hydrogen
PORTVERSION= 0.9.3
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@ -42,6 +42,8 @@ OPTIONS= JACK "JACK support" off \
LRDF "LRDF support" off \
FLAC "FLAC support" on
.include <bsd.port.pre.mk>
.if defined(WITH_JACK)
LIB_DEPENDS+= jack:${PORTSDIR}/audio/jack
CPPFLAGS+= ${PTHREAD_CFLAGS}
@ -66,7 +68,7 @@ CONFIGURE_ARGS+=--disable-lrdf-support
.endif
.if defined(WITH_FLAC)
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
.else
CONFIGURE_ARGS+=--disable-flac-support
.endif
@ -110,4 +112,4 @@ do-install:
${MKDIR} ${MAN1PREFIX}/man/ru.KOI8-R/man1
${INSTALL_MAN} ${WRKSRC}/man/ru/hydrogen.1 ${MAN1PREFIX}/man/ru.KOI8-R/man1
.include <bsd.port.mk>
.include <bsd.port.post.mk>

View File

@ -0,0 +1,21 @@
--- src/lib/FLACFile.cpp.orig 2008-03-27 21:03:52.000000000 +0100
+++ src/lib/FLACFile.cpp 2008-03-27 21:05:03.000000000 +0100
@@ -164,15 +164,13 @@ void FLACFile_real::load( string sFilena
}
set_metadata_ignore_all();
- set_filename( sFilename.c_str() );
- State s=init();
- if( s != FLAC__FILE_DECODER_OK ) {
+ if( FLAC__STREAM_DECODER_INIT_STATUS_OK != init( sFilename.c_str() ) ) {
errorLog( "[load] Error in init()" );
}
- if ( process_until_end_of_file() == false ) {
- errorLog( "[load] Error in process_until_end_of_file()" );
+ if ( process_until_end_of_stream() == false ) {
+ errorLog( "[load] Error in process_until_end_of_stream()" );
}
}

View File

@ -7,7 +7,7 @@
PORTNAME= ices
PORTVERSION= 0.4
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= audio net
MASTER_SITES= http://svn.xiph.org/releases/ices/
@ -45,7 +45,7 @@ MAN1= ices0.1
.if !defined(WITH_FLAC)
CONFIGURE_ARGS+=--without-flac
.else
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac \
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac \
mp3lame:${PORTSDIR}/audio/lame
.endif

View File

@ -7,6 +7,7 @@
PORTNAME= kid3
PORTVERSION= 1.0
PORTREVISION= 1
CATEGORIES= audio kde
MASTER_SITES= SF
@ -14,7 +15,7 @@ MAINTAINER= makc@issp.ac.ru
COMMENT= MP3/Ogg/FLAC tag editor for KDE
LIB_DEPENDS= id3-3.8.3:${PORTSDIR}/audio/id3lib \
FLAC.7:${PORTSDIR}/audio/flac \
FLAC.10:${PORTSDIR}/audio/flac \
ogg.5:${PORTSDIR}/audio/libogg \
vorbis.4:${PORTSDIR}/audio/libvorbis \
tunepimp.5:${PORTSDIR}/audio/libtunepimp \

View File

@ -7,6 +7,7 @@
PORTNAME= kid3
PORTVERSION= 1.0
PORTREVISION= 1
CATEGORIES= audio kde
MASTER_SITES= SF
@ -14,7 +15,7 @@ MAINTAINER= makc@issp.ac.ru
COMMENT= MP3/Ogg/FLAC tag editor for KDE
LIB_DEPENDS= id3-3.8.3:${PORTSDIR}/audio/id3lib \
FLAC.7:${PORTSDIR}/audio/flac \
FLAC.10:${PORTSDIR}/audio/flac \
ogg.5:${PORTSDIR}/audio/libogg \
vorbis.4:${PORTSDIR}/audio/libvorbis \
tunepimp.5:${PORTSDIR}/audio/libtunepimp \

View File

@ -7,7 +7,7 @@
PORTNAME= libsndfile
PORTVERSION= 1.0.17
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= audio
MASTER_SITES= http://www.mega-nerd.com/libsndfile/
@ -30,7 +30,7 @@ OPTIONS= FLAC "Enable flac support" On
.include <bsd.port.pre.mk>
.if !defined(WITHOUT_FLAC)
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
CONFIGURE_ARGS+=--enable-flac
.else
CONFIGURE_ARGS+=--disable-flac

View File

@ -1,44 +0,0 @@
--- src/flac.c 2006-08-31 11:22:19.000000000 +0200
+++ src/flac.c 2007-07-10 21:16:47.000000000 +0200
@@ -353,6 +353,22 @@
} /* sf_flac_write_callback */
static void
+sf_flac_meta_getvorbiscomment (SF_PRIVATE *psf, int str_type, const FLAC__StreamMetadata *metadata, const char *tag)
+{
+ int i;
+ const char *value, *s;
+
+ i = FLAC__metadata_object_vorbiscomment_find_entry_from(metadata, 0, tag);
+ if (i >= 0) {
+ value = metadata->data.vorbis_comment.comments[i].entry;
+ if ((s = strchr(value, '=')) != NULL)
+ value = s + 1;
+
+ psf_store_string (psf, str_type, value);
+ }
+}
+
+static void
sf_flac_meta_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data)
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
@@ -378,6 +394,10 @@
} ;
break ;
+ case FLAC__METADATA_TYPE_VORBIS_COMMENT :
+ sf_flac_meta_getvorbiscomment (psf, SF_STR_ARTIST, metadata, "artist");
+ sf_flac_meta_getvorbiscomment (psf, SF_STR_TITLE, metadata, "title");
+ break;
default :
psf_log_printf (psf, "sf_flac_meta_callback : metadata-type %d not yet implemented.\n", metadata->type) ;
break ;
@@ -603,6 +623,7 @@
FLAC__seekable_stream_decoder_set_eof_callback (pflac->fsd, sf_flac_eof_callback) ;
FLAC__seekable_stream_decoder_set_write_callback (pflac->fsd, sf_flac_write_callback) ;
FLAC__seekable_stream_decoder_set_metadata_callback (pflac->fsd, sf_flac_meta_callback) ;
+ FLAC__seekable_stream_decoder_set_metadata_respond(pflac->fsd, FLAC__METADATA_TYPE_VORBIS_COMMENT);
FLAC__seekable_stream_decoder_set_error_callback (pflac->fsd, sf_flac_error_callback) ;
FLAC__seekable_stream_decoder_set_client_data (pflac->fsd, psf) ;

View File

@ -0,0 +1,501 @@
--- src/flac.c.orig 2006-08-31 11:22:19.000000000 +0200
+++ src/flac.c 2008-03-28 17:07:29.000000000 +0100
@@ -46,6 +46,13 @@
#include "sfendian.h"
#include "float_cast.h"
+/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */
+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
+#define LEGACY_FLAC
+#else
+#undef LEGACY_FLAC
+#endif
+
/*------------------------------------------------------------------------------
** Private static functions.
*/
@@ -60,8 +67,14 @@
} PFLAC_PCM ;
typedef struct
-{ FLAC__SeekableStreamDecoder *fsd ;
+{
+#ifdef LEGACY_FLAC
+ FLAC__SeekableStreamDecoder *fsd ;
FLAC__SeekableStreamEncoder *fse ;
+#else
+ FLAC__StreamDecoder *fsd ;
+ FLAC__StreamEncoder *fse ;
+#endif
PFLAC_PCM pcmtype ;
void* ptr ;
unsigned pos, len, remain ;
@@ -108,6 +121,7 @@
static int flac_command (SF_PRIVATE *psf, int command, void *data, int datasize) ;
/* Decoder Callbacks */
+#ifdef LEGACY_FLAC
static FLAC__SeekableStreamDecoderReadStatus sf_flac_read_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer [], unsigned *bytes, void *client_data) ;
static FLAC__SeekableStreamDecoderSeekStatus sf_flac_seek_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
static FLAC__SeekableStreamDecoderTellStatus sf_flac_tell_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
@@ -116,13 +130,29 @@
static FLAC__StreamDecoderWriteStatus sf_flac_write_callback (const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) ;
static void sf_flac_meta_callback (const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) ;
static void sf_flac_error_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) ;
+#else
+static FLAC__StreamDecoderReadStatus sf_flac_read_callback (const FLAC__StreamDecoder *decoder, FLAC__byte buffer [], size_t *bytes, void *client_data) ;
+static FLAC__StreamDecoderSeekStatus sf_flac_seek_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
+static FLAC__StreamDecoderTellStatus sf_flac_tell_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
+static FLAC__StreamDecoderLengthStatus sf_flac_length_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) ;
+static FLAC__bool sf_flac_eof_callback (const FLAC__StreamDecoder *decoder, void *client_data) ;
+static FLAC__StreamDecoderWriteStatus sf_flac_write_callback (const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) ;
+static void sf_flac_meta_callback (const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) ;
+static void sf_flac_error_callback (const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) ;
+#endif
/* Encoder Callbacks */
+#ifdef LEGACY_FLAC
static FLAC__SeekableStreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
#ifdef HAVE_FLAC_1_1_1
static FLAC__SeekableStreamEncoderTellStatus sf_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
#endif
static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const FLAC__SeekableStreamEncoder *encoder, const FLAC__byte buffer [], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data) ;
+#else
+static FLAC__StreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
+static FLAC__StreamEncoderTellStatus sf_flac_enc_tell_callback (const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
+static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const FLAC__StreamEncoder *encoder, const FLAC__byte buffer [], size_t bytes, unsigned samples, unsigned current_frame, void *client_data) ;
+#endif
static const int legal_sample_rates [] =
{ 8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000
@@ -283,51 +313,99 @@
} /* flac_buffer_copy */
+#ifdef LEGACY_FLAC
static FLAC__SeekableStreamDecoderReadStatus
sf_flac_read_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__byte buffer [], unsigned *bytes, void *client_data)
+#else
+static FLAC__StreamDecoderReadStatus
+sf_flac_read_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__byte buffer [], size_t *bytes, void *client_data)
+#endif
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
*bytes = psf_fread (buffer, 1, *bytes, psf) ;
if (*bytes > 0 && psf->error == 0)
+#ifdef LEGACY_FLAC
return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK ;
return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR ;
+#else
+ return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE ;
+
+ return FLAC__STREAM_DECODER_READ_STATUS_ABORT ;
+#endif
} /* sf_flac_read_callback */
+#ifdef LEGACY_FLAC
static FLAC__SeekableStreamDecoderSeekStatus
sf_flac_seek_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 absolute_byte_offset, void *client_data)
+#else
+static FLAC__StreamDecoderSeekStatus
+sf_flac_seek_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 absolute_byte_offset, void *client_data)
+#endif
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
psf_fseek (psf, absolute_byte_offset, SEEK_SET) ;
if (psf->error)
+#ifdef LEGACY_FLAC
return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR ;
return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK ;
+#else
+ return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR ;
+
+ return FLAC__STREAM_DECODER_SEEK_STATUS_OK ;
+#endif
} /* sf_flac_seek_callback */
+#ifdef LEGACY_FLAC
static FLAC__SeekableStreamDecoderTellStatus
sf_flac_tell_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
+#else
+static FLAC__StreamDecoderTellStatus
+sf_flac_tell_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
+#endif
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
*absolute_byte_offset = psf_ftell (psf) ;
if (psf->error)
+#ifdef LEGACY_FLAC
return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR ;
return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK ;
+#else
+ return FLAC__STREAM_DECODER_TELL_STATUS_ERROR ;
+
+ return FLAC__STREAM_DECODER_TELL_STATUS_OK ;
+#endif
} /* sf_flac_tell_callback */
+#ifdef LEGACY_FLAC
static FLAC__SeekableStreamDecoderLengthStatus
sf_flac_length_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 *stream_length, void *client_data)
+#else
+static FLAC__StreamDecoderLengthStatus
+sf_flac_length_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 *stream_length, void *client_data)
+#endif
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
if ((*stream_length = psf->filelength) == 0)
+#ifdef LEGACY_FLAC
return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR ;
return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK ;
+#else
+ return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR ;
+
+ return FLAC__STREAM_DECODER_LENGTH_STATUS_OK ;
+#endif
} /* sf_flac_length_callback */
static FLAC__bool
+#ifdef LEGACY_FLAC
sf_flac_eof_callback (const FLAC__SeekableStreamDecoder *UNUSED (decoder), void *client_data)
+#else
+sf_flac_eof_callback (const FLAC__StreamDecoder *UNUSED (decoder), void *client_data)
+#endif
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
if (psf_ftell (psf) == psf->filelength)
@@ -337,7 +415,11 @@
} /* sf_flac_eof_callback */
static FLAC__StreamDecoderWriteStatus
+#ifdef LEGACY_FLAC
sf_flac_write_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data)
+#else
+sf_flac_write_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data)
+#endif
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ;
@@ -353,7 +435,27 @@
} /* sf_flac_write_callback */
static void
+sf_flac_meta_getvorbiscomment (SF_PRIVATE *psf, int str_type, const FLAC__StreamMetadata *metadata, const char *tag)
+{
+ int i;
+ const char *value, *s;
+
+ i = FLAC__metadata_object_vorbiscomment_find_entry_from(metadata, 0, tag);
+ if (i >= 0) {
+ value = metadata->data.vorbis_comment.comments[i].entry;
+ if ((s = strchr(value, '=')) != NULL)
+ value = s + 1;
+
+ psf_store_string (psf, str_type, value);
+ }
+}
+
+static void
+#ifdef LEGACY_FLAC
sf_flac_meta_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data)
+#else
+sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data)
+#endif
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
switch (metadata->type)
@@ -378,6 +480,10 @@
} ;
break ;
+ case FLAC__METADATA_TYPE_VORBIS_COMMENT :
+ sf_flac_meta_getvorbiscomment (psf, SF_STR_ARTIST, metadata, "artist");
+ sf_flac_meta_getvorbiscomment (psf, SF_STR_TITLE, metadata, "title");
+ break;
default :
psf_log_printf (psf, "sf_flac_meta_callback : metadata-type %d not yet implemented.\n", metadata->type) ;
break ;
@@ -387,7 +493,11 @@
} /* sf_flac_meta_callback */
static void
+#ifdef LEGACY_FLAC
sf_flac_error_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__StreamDecoderErrorStatus status, void *client_data)
+#else
+sf_flac_error_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__StreamDecoderErrorStatus status, void *client_data)
+#endif
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
psf_log_printf (psf, "ERROR : %s\n", FLAC__StreamDecoderErrorStatusString [status]) ;
@@ -407,17 +517,29 @@
return ;
} /* sf_flac_error_callback */
+#ifdef LEGACY_FLAC
static FLAC__SeekableStreamEncoderSeekStatus
sf_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * UNUSED (encoder), FLAC__uint64 absolute_byte_offset, void *client_data)
+#else
+static FLAC__StreamEncoderSeekStatus
+sf_flac_enc_seek_callback (const FLAC__StreamEncoder * UNUSED (encoder), FLAC__uint64 absolute_byte_offset, void *client_data)
+#endif
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
psf_fseek (psf, absolute_byte_offset, SEEK_SET) ;
if (psf->error)
+#ifdef LEGACY_FLAC
return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_ERROR ;
return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK ;
+#else
+ return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR ;
+
+ return FLAC__STREAM_ENCODER_SEEK_STATUS_OK ;
+#endif
} /* sf_flac_enc_seek_callback */
+#ifdef LEGACY_FLAC
#ifdef HAVE_FLAC_1_1_1
static FLAC__SeekableStreamEncoderTellStatus
sf_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder *UNUSED (encoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
@@ -430,9 +552,25 @@
return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_OK ;
} /* sf_flac_enc_tell_callback */
#endif
+#else
+static FLAC__StreamEncoderTellStatus
+sf_flac_enc_tell_callback (const FLAC__StreamEncoder *UNUSED (encoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
+{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
+
+ *absolute_byte_offset = psf_ftell (psf) ;
+ if (psf->error)
+ return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR ;
+
+ return FLAC__STREAM_ENCODER_TELL_STATUS_OK ;
+} /* sf_flac_enc_tell_callback */
+#endif
static FLAC__StreamEncoderWriteStatus
+#ifdef LEGACY_FLAC
sf_flac_enc_write_callback (const FLAC__SeekableStreamEncoder * UNUSED (encoder), const FLAC__byte buffer [], unsigned bytes, unsigned UNUSED (samples), unsigned UNUSED (current_frame), void *client_data)
+#else
+sf_flac_enc_write_callback (const FLAC__StreamEncoder * UNUSED (encoder), const FLAC__byte buffer [], size_t bytes, unsigned UNUSED (samples), unsigned UNUSED (current_frame), void *client_data)
+#endif
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
if (psf_fwrite (buffer, 1, bytes, psf) == bytes && psf->error == 0)
@@ -509,15 +647,27 @@
return 0 ;
if (psf->mode == SFM_WRITE)
- { FLAC__seekable_stream_encoder_finish (pflac->fse) ;
+ {
+#ifdef LEGACY_FLAC
+ FLAC__seekable_stream_encoder_finish (pflac->fse) ;
FLAC__seekable_stream_encoder_delete (pflac->fse) ;
+#else
+ FLAC__stream_encoder_finish (pflac->fse) ;
+ FLAC__stream_encoder_delete (pflac->fse) ;
+#endif
if (pflac->encbuffer)
free (pflac->encbuffer) ;
} ;
if (psf->mode == SFM_READ)
- { FLAC__seekable_stream_decoder_finish (pflac->fsd) ;
+ {
+#ifdef LEGACY_FLAC
+ FLAC__seekable_stream_decoder_finish (pflac->fsd) ;
FLAC__seekable_stream_decoder_delete (pflac->fsd) ;
+#else
+ FLAC__stream_decoder_finish (pflac->fsd) ;
+ FLAC__stream_decoder_delete (pflac->fsd) ;
+#endif
} ;
for (k = 0 ; k < ARRAY_LEN (pflac->rbuffer) ; k++)
@@ -546,17 +696,6 @@
return SFE_FLAC_BAD_SAMPLE_RATE ;
psf_fseek (psf, 0, SEEK_SET) ;
- if ((pflac->fse = FLAC__seekable_stream_encoder_new ()) == NULL)
- return SFE_FLAC_NEW_DECODER ;
- FLAC__seekable_stream_encoder_set_write_callback (pflac->fse, sf_flac_enc_write_callback) ;
- FLAC__seekable_stream_encoder_set_seek_callback (pflac->fse, sf_flac_enc_seek_callback) ;
-
-#ifdef HAVE_FLAC_1_1_1
- FLAC__seekable_stream_encoder_set_tell_callback (pflac->fse, sf_flac_enc_tell_callback) ;
-#endif
- FLAC__seekable_stream_encoder_set_client_data (pflac->fse, psf) ;
- FLAC__seekable_stream_encoder_set_channels (pflac->fse, psf->sf.channels) ;
- FLAC__seekable_stream_encoder_set_sample_rate (pflac->fse, psf->sf.samplerate) ;
switch (psf->sf.format & SF_FORMAT_SUBMASK)
{ case SF_FORMAT_PCM_S8 :
@@ -574,12 +713,36 @@
break ;
} ;
+#ifdef LEGACY_FLAC
+ if ((pflac->fse = FLAC__seekable_stream_encoder_new ()) == NULL)
+ return SFE_FLAC_NEW_DECODER ;
+ FLAC__seekable_stream_encoder_set_write_callback (pflac->fse, sf_flac_enc_write_callback) ;
+ FLAC__seekable_stream_encoder_set_seek_callback (pflac->fse, sf_flac_enc_seek_callback) ;
+
+#ifdef HAVE_FLAC_1_1_1
+ FLAC__seekable_stream_encoder_set_tell_callback (pflac->fse, sf_flac_enc_tell_callback) ;
+#endif
+ FLAC__seekable_stream_encoder_set_client_data (pflac->fse, psf) ;
+ FLAC__seekable_stream_encoder_set_channels (pflac->fse, psf->sf.channels) ;
+ FLAC__seekable_stream_encoder_set_sample_rate (pflac->fse, psf->sf.samplerate) ;
FLAC__seekable_stream_encoder_set_bits_per_sample (pflac->fse, bps) ;
if ((bps = FLAC__seekable_stream_encoder_init (pflac->fse)) != FLAC__SEEKABLE_STREAM_DECODER_OK)
{ psf_log_printf (psf, "Error : FLAC encoder init returned error : %s\n", FLAC__seekable_stream_encoder_get_resolved_state_string (pflac->fse)) ;
return SFE_FLAC_INIT_DECODER ;
} ;
+#else
+ if ((pflac->fse = FLAC__stream_encoder_new ()) == NULL)
+ return SFE_FLAC_NEW_DECODER ;
+ FLAC__stream_encoder_set_channels (pflac->fse, psf->sf.channels) ;
+ FLAC__stream_encoder_set_sample_rate (pflac->fse, psf->sf.samplerate) ;
+ FLAC__stream_encoder_set_bits_per_sample (pflac->fse, bps) ;
+
+ if ((bps = FLAC__stream_encoder_init_stream (pflac->fse, sf_flac_enc_write_callback, sf_flac_enc_seek_callback, sf_flac_enc_tell_callback, NULL, psf)) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
+ { psf_log_printf (psf, "Error : FLAC encoder init returned error : %s\n", FLAC__StreamEncoderInitStatusString[bps]) ;
+ return SFE_FLAC_INIT_DECODER ;
+ } ;
+#endif
if (psf->error == 0)
psf->dataoffset = psf_ftell (psf) ;
@@ -593,6 +756,7 @@
{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ;
psf_fseek (psf, 0, SEEK_SET) ;
+#ifdef LEGACY_FLAC
if ((pflac->fsd = FLAC__seekable_stream_decoder_new ()) == NULL)
return SFE_FLAC_NEW_DECODER ;
@@ -603,6 +767,7 @@
FLAC__seekable_stream_decoder_set_eof_callback (pflac->fsd, sf_flac_eof_callback) ;
FLAC__seekable_stream_decoder_set_write_callback (pflac->fsd, sf_flac_write_callback) ;
FLAC__seekable_stream_decoder_set_metadata_callback (pflac->fsd, sf_flac_meta_callback) ;
+ FLAC__seekable_stream_decoder_set_metadata_respond(pflac->fsd, FLAC__METADATA_TYPE_VORBIS_COMMENT);
FLAC__seekable_stream_decoder_set_error_callback (pflac->fsd, sf_flac_error_callback) ;
FLAC__seekable_stream_decoder_set_client_data (pflac->fsd, psf) ;
@@ -610,9 +775,24 @@
return SFE_FLAC_INIT_DECODER ;
FLAC__seekable_stream_decoder_process_until_end_of_metadata (pflac->fsd) ;
+#else
+ if ((pflac->fsd = FLAC__stream_decoder_new ()) == NULL)
+ return SFE_FLAC_NEW_DECODER ;
+
+ FLAC__stream_decoder_set_metadata_respond(pflac->fsd, FLAC__METADATA_TYPE_VORBIS_COMMENT);
+
+ if (FLAC__stream_decoder_init_stream (pflac->fsd, sf_flac_read_callback, sf_flac_seek_callback, sf_flac_tell_callback, sf_flac_length_callback, sf_flac_eof_callback, sf_flac_write_callback, sf_flac_meta_callback, sf_flac_error_callback, psf) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
+ return SFE_FLAC_INIT_DECODER ;
+
+ FLAC__stream_decoder_process_until_end_of_metadata (pflac->fsd) ;
+#endif
if (psf->error == 0)
{ FLAC__uint64 position ;
+#ifdef LEGACY_FLAC
FLAC__seekable_stream_decoder_get_decode_position (pflac->fsd, &position) ;
+#else
+ FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
+#endif
psf->dataoffset = position ;
} ;
@@ -676,10 +856,18 @@
flac_buffer_copy (psf) ;
while (pflac->pos < pflac->len)
- { if (FLAC__seekable_stream_decoder_process_single (pflac->fsd) == 0)
+ {
+#ifdef LEGACY_FLAC
+ if (FLAC__seekable_stream_decoder_process_single (pflac->fsd) == 0)
break ;
if (FLAC__seekable_stream_decoder_get_state (pflac->fsd) != FLAC__SEEKABLE_STREAM_DECODER_OK)
break ;
+#else
+ if (FLAC__stream_decoder_process_single (pflac->fsd) == 0)
+ break ;
+ if (FLAC__stream_decoder_get_state (pflac->fsd) >= FLAC__STREAM_DECODER_END_OF_STREAM)
+ break ;
+#endif
} ;
pflac->ptr = NULL ;
@@ -795,7 +983,11 @@
while (len > 0)
{ writecount = (len >= bufferlen) ? bufferlen : (int) len ;
convert (ptr + total, buffer, writecount) ;
+#ifdef LEGACY_FLAC
if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
+#else
+ if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
+#endif
thiswrite = writecount ;
else
break ;
@@ -837,7 +1029,11 @@
while (len > 0)
{ writecount = (len >= bufferlen) ? bufferlen : (int) len ;
convert (ptr + total, buffer, writecount) ;
+#ifdef LEGACY_FLAC
if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
+#else
+ if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
+#endif
thiswrite = writecount ;
else
break ;
@@ -879,7 +1075,11 @@
while (len > 0)
{ writecount = (len >= bufferlen) ? bufferlen : (int) len ;
convert (ptr + total, buffer, writecount, psf->norm_float) ;
+#ifdef LEGACY_FLAC
if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
+#else
+ if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
+#endif
thiswrite = writecount ;
else
break ;
@@ -1011,7 +1211,11 @@
while (len > 0)
{ writecount = (len >= bufferlen) ? bufferlen : (int) len ;
convert (ptr + total, buffer, writecount, psf->norm_double) ;
+#ifdef LEGACY_FLAC
if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
+#else
+ if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
+#endif
thiswrite = writecount ;
else
break ;
@@ -1131,10 +1335,17 @@
if (psf->mode == SFM_READ)
{ FLAC__uint64 position ;
+#ifdef LEGACY_FLAC
if (FLAC__seekable_stream_decoder_seek_absolute (pflac->fsd, offset))
{ FLAC__seekable_stream_decoder_get_decode_position (pflac->fsd, &position) ;
return offset ;
} ;
+#else
+ if (FLAC__stream_decoder_seek_absolute (pflac->fsd, offset))
+ { FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
+ return offset ;
+ } ;
+#endif
return ((sf_count_t) -1) ;
} ;

View File

@ -7,7 +7,7 @@
PORTNAME= libtunepimp-old
PORTVERSION= 0.4.2
PORTREVISION= 4
PORTREVISION= 5
PORTEPOCH= 2
CATEGORIES= audio
MASTER_SITES= http://ftp.musicbrainz.org/pub/musicbrainz/ \

View File

@ -0,0 +1,57 @@
--- plugins/flac/flacdecode.cpp.orig 2008-03-28 21:05:11.000000000 +0100
+++ plugins/flac/flacdecode.cpp 2008-03-28 21:08:21.000000000 +0100
@@ -28,6 +28,14 @@
#include <string.h>
#include "flacdecode.h"
+#include <FLAC/export.h>
+/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */
+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
+#define LEGACY_FLAC
+#else
+#undef LEGACY_FLAC
+#endif
+
void FLAC_errorcb(const FLAC__StreamDecoder * decoder,
FLAC__StreamDecoderErrorStatus status, void *client_data)
{
@@ -99,7 +107,11 @@ FLAC__StreamDecoderWriteStatus FLAC_writ
FLAC__StreamDecoderReadStatus FLAC_readcb(const FLAC__StreamDecoder *decoder,
FLAC__byte buffer[],
+#ifdef LEGACY_FLAC
unsigned *bytes,
+#else
+ size_t *bytes,
+#endif
void *client_data)
{
clientdata_t *cd = reinterpret_cast < clientdata_t * >(client_data);
@@ -131,6 +143,7 @@ FlacDecode::FlacDecode(const string & fi
if (!cd.in)
return;
+#ifdef LEGACY_FLAC
if (!FLAC__stream_decoder_set_read_callback(decoder, &FLAC_readcb))
return;
@@ -149,6 +162,10 @@ FlacDecode::FlacDecode(const string & fi
state = FLAC__stream_decoder_init(decoder);
if (state != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA)
return;
+#else
+ if (FLAC__stream_decoder_init_stream(decoder, &FLAC_readcb, NULL, NULL, NULL, NULL, &FLAC_writecb, &FLAC_metadatacb, &FLAC_errorcb, &cd) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
+ return;
+#endif
FLAC__stream_decoder_process_until_end_of_metadata(decoder);
state = FLAC__stream_decoder_get_state(decoder);
@@ -221,6 +238,8 @@ int FlacDecode::read(char *data, int max
break;
state = FLAC__stream_decoder_get_state(decoder);
+ if (state == FLAC__STREAM_DECODER_END_OF_STREAM)
+ break;
if (state != FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC ||
state != FLAC__STREAM_DECODER_READ_FRAME)
{

View File

@ -0,0 +1,11 @@
--- plugins/flac/flacdecode.h.orig 2008-03-28 21:08:34.000000000 +0100
+++ plugins/flac/flacdecode.h 2008-03-28 21:08:49.000000000 +0100
@@ -27,7 +27,7 @@
#ifndef __VORBIS_DECODE_H
#define __VORBIS_DECODE_H
-#include <FLAC/file_decoder.h>
+#include <FLAC/stream_decoder.h>
#include <string>
#include "decode_plugin.h"
#include "fileio.h"

View File

@ -7,7 +7,7 @@
PORTNAME= libtunepimp
PORTVERSION= 0.5.3
PORTREVISION= 1
PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= audio
MASTER_SITES= http://ftp.musicbrainz.org/pub/musicbrainz/ \

View File

@ -7,7 +7,7 @@
PORTNAME= lmms
PORTVERSION= 20061204
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= jylefort

View File

@ -7,10 +7,14 @@
PORTNAME= moc
PORTVERSION= 2.4.1
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= audio
MASTER_SITES= ftp://ftp.daper.net/pub/soft/moc/stable/
PATCH_SITES= ftp://ftp.daper.net/pub/soft/moc/patches/
PATCHFILES= moc-2.4.1-flac-1.1.3.patch.bz2
PATCH_DIST_STRIP=-p1
MAINTAINER= rzinkov@gmail.com
COMMENT= A console audio player designed to be powerful and easy to use

View File

@ -1,3 +1,6 @@
MD5 (moc-2.4.1.tar.bz2) = 7b760a9c05d3f50781d06ed2d83aaee8
SHA256 (moc-2.4.1.tar.bz2) = 0f4ef44e86b7edb4ee910f8b5c02efa59985ab1a0cf2f57497c71a2932699d28
SIZE (moc-2.4.1.tar.bz2) = 439866
MD5 (moc-2.4.1-flac-1.1.3.patch.bz2) = acfc8fcc893e85ea3cd70bbfb8079f67
SHA256 (moc-2.4.1-flac-1.1.3.patch.bz2) = 63428811de52331a2d6c1aa3590975faa1ef396ce13a5492143e7d313eed07be
SIZE (moc-2.4.1-flac-1.1.3.patch.bz2) = 2200

View File

@ -8,6 +8,7 @@
PORTNAME= muine
PORTVERSION= 0.8.8
PORTREVISION= 1
CATEGORIES= audio gnome
MASTER_SITES= http://muine-player.org/releases/ \
${MASTER_SITE_LOCAL}
@ -16,7 +17,7 @@ MASTER_SITE_SUBDIR= tmclaugh/muine
MAINTAINER= bsd-sharp-list@forge.novell.com
COMMENT= Mono based Gnome audio player
LIB_DEPENDS= FLAC.7:${PORTSDIR}/audio/flac \
LIB_DEPENDS= FLAC.10:${PORTSDIR}/audio/flac \
id3tag.0:${PORTSDIR}/audio/libid3tag \
gdbm:${PORTSDIR}/databases/gdbm \
vorbis.4:${PORTSDIR}/audio/libvorbis \

View File

@ -7,7 +7,7 @@
PORTNAME= musicpd
PORTVERSION= 0.13.1
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= audio ipv6
MASTER_SITES= http://musicpd.org/uploads/files/ \
http://redundancy.redundancy.org/mirror/
@ -45,7 +45,7 @@ CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS+=--disable-flac \
--disable-oggflac
.else
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
.endif
.ifdef(WITHOUT_VORBIS)

View File

@ -7,6 +7,7 @@
PORTNAME= Audio-FLAC-Header
PORTVERSION= 1.9
PORTREVISION= 1
CATEGORIES= audio perl5
MASTER_SITES= CPAN
PKGNAMEPREFIX= p5-
@ -14,7 +15,7 @@ PKGNAMEPREFIX= p5-
MAINTAINER= infofarmer@FreeBSD.org
COMMENT= Interface to FLAC header metadata
LIB_DEPENDS= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS= FLAC.10:${PORTSDIR}/audio/flac
PERL_CONFIGURE= yes
CFLAGS+= -I${LOCALBASE}/include

View File

@ -17,6 +17,8 @@ COMMENT= Python module that provides the Free Lossless Audio Codec interface
LIB_DEPENDS= FLAC.7:${PORTSDIR}/audio/flac
BUILD_DEPENDS= swig:${PORTSDIR}/devel/swig13
IGNORE= has been abandoned, needs rewrite for FLAC 1.1.3+
USE_PYTHON= yes
USE_GMAKE= yes
USE_PYDISTUTILS= yes

View File

@ -7,7 +7,7 @@
PORTNAME= rezound
DISTVERSION= 0.12.3beta
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@ -72,7 +72,7 @@ LIB_DEPENDS+= vorbis.4:${PORTSDIR}/audio/libvorbis
.endif
.if defined(WITH_FLAC)
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
.endif
.if defined(WITH_FFTW)

View File

@ -0,0 +1,69 @@
--- src/backend/CFLACSoundTranslator.cpp.orig 2005-05-01 06:39:38.000000000 +0200
+++ src/backend/CFLACSoundTranslator.cpp 2008-03-28 18:08:28.000000000 +0100
@@ -75,15 +75,15 @@ public:
for(unsigned t=0;t<MAX_CHANNELS;t++)
accessers[t]=NULL;
- set_filename(filename.c_str());
+ //set_filename(filename.c_str());
set_metadata_ignore_all();
//set_metadata_respond(FLAC__METADATA_TYPE_VORBIS_COMMENT);
//set_metadata_respond(FLAC__METADATA_TYPE_CUESHEET);
- State s=init();
- if(s!=FLAC__FILE_DECODER_OK)
- throw runtime_error(string(__func__)+" -- "+s.as_cstring());
+ FLAC__StreamDecoderInitStatus s=init(filename.c_str());
+ if(s!=FLAC__STREAM_DECODER_INIT_STATUS_OK)
+ throw runtime_error(string(__func__)+" -- "+FLAC__StreamDecoderInitStatusString[s]);
}
virtual ~MyFLACDecoderFile()
@@ -170,7 +170,7 @@ protected:
// update status bar and detect user cancel
FLAC__uint64 filePosition;
- FLAC__file_decoder_get_decode_position(decoder_, &filePosition);
+ FLAC__stream_decoder_get_decode_position(decoder_, &filePosition);
return statusBar.update(filePosition) ? FLAC__STREAM_DECODER_WRITE_STATUS_ABORT : FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
@@ -215,7 +215,7 @@ private:
bool CFLACSoundTranslator::onLoadSound(const string filename,CSound *sound) const
{
MyFLACDecoderFile f(filename,sound);
- return f.process_until_end_of_file();
+ return f.process_until_end_of_stream();
}
@@ -258,7 +258,7 @@ bool CFLACSoundTranslator::onSaveSound(c
MyFLACEncoderFile f(saveLength);
- f.set_filename(filename.c_str());
+ //f.set_filename(filename.c_str());
f.set_channels(sound->getChannelCount());
@@ -274,8 +274,8 @@ bool CFLACSoundTranslator::onSaveSound(c
//f.set_metadata(...) // ??? to do to set cues and user notes, etc
- MyFLACEncoderFile::State s=f.init();
- if(s==FLAC__STREAM_ENCODER_OK)
+ FLAC__StreamEncoderInitStatus s=f.init(filename.c_str());
+ if(s==FLAC__STREAM_ENCODER_INIT_STATUS_OK)
{
#define BUFFER_SIZE 65536
TAutoBuffer<FLAC__int32> buffers[MAX_CHANNELS];
@@ -328,7 +328,7 @@ bool CFLACSoundTranslator::onSaveSound(c
return true;
}
else
- throw runtime_error(string(__func__)+" -- error creating FLAC encoder -- "+s.as_cstring());
+ throw runtime_error(string(__func__)+" -- error creating FLAC encoder -- "+FLAC__StreamEncoderInitStatusString[s]);
}

View File

@ -7,7 +7,7 @@
PORTNAME= sdl_sound
PORTVERSION= 1.0.1
PORTREVISION= 13
PORTREVISION= 14
CATEGORIES= audio
MASTER_SITES= http://www.icculus.org/SDL_sound/downloads/
DISTNAME= SDL_sound-${PORTVERSION}
@ -32,7 +32,7 @@ OPTIONS= FLAC "Enable flac support" on \
.include <bsd.port.pre.mk>
.if !defined(WITHOUT_FLAC)
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
.else
CONFIGURE_ARGS+=--disable-flac
.endif

View File

@ -1,5 +1,5 @@
--- configure.orig Mon Oct 13 03:54:57 2003
+++ configure Mon Oct 13 07:44:41 2003
--- configure.orig 2003-10-12 20:54:57.000000000 +0200
+++ configure 2008-03-27 21:35:53.000000000 +0100
@@ -6684,6 +6684,7 @@
# This can be used to rebuild libtool when needed
@ -8,3 +8,12 @@
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -7089,7 +7090,7 @@
fi
-x="C__seekable_stream_decoder_process_single"
+x="C__stream_decoder_process_single"
flcsym="FLA$x"
# Check whether --enable-flac or --disable-flac was given.
if test "${enable_flac+set}" = set; then

View File

@ -0,0 +1,99 @@
--- decoders/flac.c.orig 2003-03-10 23:44:14.000000000 +0100
+++ decoders/flac.c 2008-03-27 21:35:30.000000000 +0100
@@ -44,42 +44,33 @@
#define __SDL_SOUND_INTERNAL__
#include "SDL_sound_internal.h"
-#include <FLAC/seekable_stream_decoder.h>
+#include <FLAC/stream_decoder.h>
-#define D_END_OF_STREAM FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM
+#define D_END_OF_STREAM FLAC__STREAM_DECODER_END_OF_STREAM
-#define d_new() FLAC__seekable_stream_decoder_new()
-#define d_init(x) FLAC__seekable_stream_decoder_init(x)
-#define d_process_metadata(x) FLAC__seekable_stream_decoder_process_until_end_of_metadata(x)
-#define d_process_one_frame(x) FLAC__seekable_stream_decoder_process_single(x)
-#define d_get_state(x) FLAC__seekable_stream_decoder_get_state(x)
-#define d_finish(x) FLAC__seekable_stream_decoder_finish(x)
-#define d_delete(x) FLAC__seekable_stream_decoder_delete(x)
-#define d_set_read_callback(x, y) FLAC__seekable_stream_decoder_set_read_callback(x, y)
-#define d_set_write_callback(x, y) FLAC__seekable_stream_decoder_set_write_callback(x, y)
-#define d_set_metadata_callback(x, y) FLAC__seekable_stream_decoder_set_metadata_callback(x, y)
-#define d_set_error_callback(x, y) FLAC__seekable_stream_decoder_set_error_callback(x, y)
-#define d_set_client_data(x, y) FLAC__seekable_stream_decoder_set_client_data(x, y)
-
-typedef FLAC__SeekableStreamDecoder decoder_t;
-typedef FLAC__SeekableStreamDecoderReadStatus d_read_status_t;
-
-#define D_SEEK_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK
-#define D_SEEK_STATUS_ERROR FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR
-#define D_TELL_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK
-#define D_TELL_STATUS_ERROR FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR
-#define D_LENGTH_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK
-#define D_LENGTH_STATUS_ERROR FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR
-
-#define d_set_seek_callback(x, y) FLAC__seekable_stream_decoder_set_seek_callback(x, y)
-#define d_set_tell_callback(x, y) FLAC__seekable_stream_decoder_set_tell_callback(x, y)
-#define d_set_length_callback(x, y) FLAC__seekable_stream_decoder_set_length_callback(x, y)
-#define d_set_eof_callback(x, y) FLAC__seekable_stream_decoder_set_eof_callback(x, y)
-#define d_seek_absolute(x, y) FLAC__seekable_stream_decoder_seek_absolute(x, y)
-
-typedef FLAC__SeekableStreamDecoderSeekStatus d_seek_status_t;
-typedef FLAC__SeekableStreamDecoderTellStatus d_tell_status_t;
-typedef FLAC__SeekableStreamDecoderLengthStatus d_length_status_t;
+#define d_new() FLAC__stream_decoder_new()
+#define d_init(a,b,c,d,e,f,g,h,i,j) FLAC__stream_decoder_init_stream(a,b,c,d,e,f,g,h,i,j)
+#define d_process_metadata(x) FLAC__stream_decoder_process_until_end_of_metadata(x)
+#define d_process_one_frame(x) FLAC__stream_decoder_process_single(x)
+#define d_get_state(x) FLAC__stream_decoder_get_state(x)
+#define d_finish(x) FLAC__stream_decoder_finish(x)
+#define d_delete(x) FLAC__stream_decoder_delete(x)
+
+typedef FLAC__StreamDecoder decoder_t;
+typedef FLAC__StreamDecoderReadStatus d_read_status_t;
+
+#define D_SEEK_STATUS_OK FLAC__STREAM_DECODER_SEEK_STATUS_OK
+#define D_SEEK_STATUS_ERROR FLAC__STREAM_DECODER_SEEK_STATUS_ERROR
+#define D_TELL_STATUS_OK FLAC__STREAM_DECODER_TELL_STATUS_OK
+#define D_TELL_STATUS_ERROR FLAC__STREAM_DECODER_TELL_STATUS_ERROR
+#define D_LENGTH_STATUS_OK FLAC__STREAM_DECODER_LENGTH_STATUS_OK
+#define D_LENGTH_STATUS_ERROR FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR
+
+#define d_seek_absolute(x, y) FLAC__stream_decoder_seek_absolute(x, y)
+
+typedef FLAC__StreamDecoderSeekStatus d_seek_status_t;
+typedef FLAC__StreamDecoderTellStatus d_tell_status_t;
+typedef FLAC__StreamDecoderLengthStatus d_length_status_t;
#define D_WRITE_CONTINUE FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
#define D_READ_END_OF_STREAM FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM
@@ -400,17 +391,6 @@
BAIL_MACRO(ERR_OUT_OF_MEMORY, 0);
} /* if */
- d_set_read_callback(decoder, read_callback);
- d_set_write_callback(decoder, write_callback);
- d_set_metadata_callback(decoder, metadata_callback);
- d_set_error_callback(decoder, error_callback);
- d_set_seek_callback(decoder, seek_callback);
- d_set_tell_callback(decoder, tell_callback);
- d_set_length_callback(decoder, length_callback);
- d_set_eof_callback(decoder, eof_callback);
-
- d_set_client_data(decoder, f);
-
f->rw = internal->rw;
f->sample = sample;
f->decoder = decoder;
@@ -418,7 +398,9 @@
f->is_flac = 0 /* !!! FIXME: should be "has_extension", not "0". */;
internal->decoder_private = f;
- d_init(decoder);
+ d_init(decoder, read_callback, seek_callback, tell_callback,
+ length_callback, eof_callback, write_callback, metadata_callback,
+ error_callback, f);
sample->flags = SOUND_SAMPLEFLAG_NONE;

View File

@ -7,6 +7,7 @@
PORTNAME= sox
PORTVERSION= 14.0.1
PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= SF
@ -122,7 +123,7 @@ CONFIGURE_ARGS+= --without-lame
.if defined(WITH_FLAC)
CONFIGURE_ARGS+= --with-flac
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
PLIST_SUB+= PLIST_FLAC=""
.else
CONFIGURE_ARGS+= --without-flac

View File

@ -6,7 +6,7 @@
PORTNAME= squash
PORTVERSION= 1.0
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= ${PORTNAME}
@ -14,7 +14,7 @@ MASTER_SITE_SUBDIR= ${PORTNAME}
MAINTAINER= matthias.andree@gmx.de
COMMENT= Learning console-based MP3/OGG player
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac \
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac \
fftw.2:${PORTSDIR}/math/fftw \
id3-3.8.3:${PORTSDIR}/audio/id3lib \
mad.2:${PORTSDIR}/audio/mad \

View File

@ -0,0 +1,31 @@
$FreeBSD$
--- include/play_flac.h.orig
+++ include/play_flac.h
@@ -32,7 +32,7 @@
* Structures
*/
typedef struct flac_data_s {
- FLAC__FileDecoder *decoder;
+ FLAC__StreamDecoder *decoder;
char *buffer;
int buffer_size;
int channels;
@@ -45,11 +45,11 @@
* Prototypes
*/
void *flac_open( char *filename, sound_format_t *sound_format );
-void flac_error_callback( const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data );
-FLAC__StreamDecoderWriteStatus flac_write_callback_load_meta( const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data );
-void flac_metadata_callback_load_meta( const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data );
-FLAC__StreamDecoderWriteStatus flac_write_callback_decode_frame( const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data );
-void flac_metadata_callback_decode_frame( const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data );
+void flac_error_callback( const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data );
+FLAC__StreamDecoderWriteStatus flac_write_callback_load_meta( const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data );
+void flac_metadata_callback_load_meta( const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data );
+FLAC__StreamDecoderWriteStatus flac_write_callback_decode_frame( const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data );
+void flac_metadata_callback_decode_frame( const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data );
void flac_load_meta( void *data, char *filename );
frame_data_t flac_decode_frame( void *data );
long flac_calc_duration( void *data );

View File

@ -0,0 +1,231 @@
$FreeBSD$
--- src/play_flac.c.orig
+++ src/play_flac.c
@@ -24,7 +24,7 @@
#include "database.h" /* for insert_meta_data */
#include "play_flac.h"
-void flac_error_callback(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) {
+void flac_error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) {
/* errors? we don't need no stinking errors */
return;
}
@@ -36,47 +36,26 @@
*/
void *flac_open( char *filename, sound_format_t *sound_format ) {
flac_data_t *flac_data;
- FLAC__FileDecoderState state;
+ FLAC__StreamDecoderInitStatus state;
/* Allocate space for data */
squash_malloc( flac_data, sizeof(flac_data_t) );
- if( (flac_data->decoder = FLAC__file_decoder_new()) == NULL ) {
+ if( (flac_data->decoder = FLAC__stream_decoder_new()) == NULL ) {
squash_free( flac_data );
return (void *)NULL;
// squash_error( "Unable to create flac decoder" );
}
- if( !FLAC__file_decoder_set_filename( flac_data->decoder, filename ) ) {
- squash_free( flac_data );
- return (void *)NULL;
- // squash_error( "Unable to set filename in decoder" );
- }
-
- FLAC__file_decoder_set_metadata_callback( flac_data->decoder, flac_metadata_callback_decode_frame );
-
- FLAC__file_decoder_set_write_callback( flac_data->decoder, flac_write_callback_decode_frame );
-
- FLAC__file_decoder_set_error_callback( flac_data->decoder, flac_error_callback );
-
- FLAC__file_decoder_set_client_data( flac_data->decoder, flac_data );
-
- state = FLAC__file_decoder_init( flac_data->decoder );
+ state = FLAC__stream_decoder_init_file( flac_data->decoder, filename, flac_write_callback_decode_frame, flac_metadata_callback_decode_frame, flac_error_callback, flac_data );
switch( state ) {
- case FLAC__FILE_DECODER_OK:
+ case FLAC__STREAM_DECODER_INIT_STATUS_OK:
/* no problem */
break;
- case FLAC__FILE_DECODER_END_OF_FILE:
- case FLAC__FILE_DECODER_ERROR_OPENING_FILE:
- case FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR:
- case FLAC__FILE_DECODER_SEEK_ERROR:
- case FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR:
- case FLAC__FILE_DECODER_ALREADY_INITIALIZED:
- case FLAC__FILE_DECODER_INVALID_CALLBACK:
- case FLAC__FILE_DECODER_UNINITIALIZED:
+ default:
squash_free( flac_data );
return (void *)NULL;
- // squash_error( "Unable to initialize decoder: %s", FLAC__FileDecoderStateString[ state ] );
+ // squash_error( "Unable to initialize decoder: %s", FLAC__StreamDecoderInitStatusString[ state ] );
break;
}
@@ -86,7 +65,7 @@
flac_data->sample_rate = -1;
flac_data->duration = -1;
- FLAC__file_decoder_process_until_end_of_metadata( flac_data->decoder );
+ FLAC__stream_decoder_process_until_end_of_metadata( flac_data->decoder );
sound_format->rate = flac_data->sample_rate;
sound_format->channels = flac_data->channels;
@@ -97,12 +76,12 @@
return (void *)flac_data;
}
-FLAC__StreamDecoderWriteStatus flac_write_callback_load_meta( const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data ) {
+FLAC__StreamDecoderWriteStatus flac_write_callback_load_meta( const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data ) {
/* do nothing ignore any decoded frames (when just loading meta data)*/
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
-void flac_metadata_callback_load_meta( const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data ) {
+void flac_metadata_callback_load_meta( const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data ) {
FLAC__StreamMetadata_VorbisComment comment = metadata->data.vorbis_comment;
int i;
char *start, *end, *key, *value;
@@ -128,7 +107,7 @@
}
}
-FLAC__StreamDecoderWriteStatus flac_write_callback_decode_frame( const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data ) {
+FLAC__StreamDecoderWriteStatus flac_write_callback_decode_frame( const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data ) {
flac_data_t *flac_data = (flac_data_t *)client_data;
int i, j, k;
@@ -158,7 +137,7 @@
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
-void flac_metadata_callback_decode_frame( const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data ) {
+void flac_metadata_callback_decode_frame( const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data ) {
flac_data_t *flac_data = (flac_data_t *)client_data;
if( metadata->type != FLAC__METADATA_TYPE_STREAMINFO ) {
@@ -172,47 +151,29 @@
}
void flac_load_meta( void *data, char *filename ) {
- FLAC__FileDecoder *decoder;
- FLAC__FileDecoderState state;
+ FLAC__StreamDecoder *decoder;
+ FLAC__StreamDecoderInitStatus state;
- if( (decoder = FLAC__file_decoder_new()) == NULL ) {
+ if( (decoder = FLAC__stream_decoder_new()) == NULL ) {
squash_error( "Unable to create flac decoder" );
}
- if( !FLAC__file_decoder_set_filename( decoder, filename ) ) {
- squash_error( "Unable to set filename in decoder" );
- }
-
- FLAC__file_decoder_set_metadata_callback( decoder, flac_metadata_callback_load_meta );
- FLAC__file_decoder_set_metadata_respond_all( decoder );
-
- FLAC__file_decoder_set_write_callback( decoder, flac_write_callback_load_meta );
-
- FLAC__file_decoder_set_error_callback( decoder, flac_error_callback );
-
- FLAC__file_decoder_set_client_data( decoder, data );
+ FLAC__stream_decoder_set_metadata_respond_all( decoder );
- state = FLAC__file_decoder_init( decoder );
+ state = FLAC__stream_decoder_init_file( decoder, filename, flac_write_callback_load_meta, flac_metadata_callback_load_meta, flac_error_callback, data );
switch( state ) {
- case FLAC__FILE_DECODER_OK:
+ case FLAC__STREAM_DECODER_INIT_STATUS_OK:
/* no problem */
break;
- case FLAC__FILE_DECODER_END_OF_FILE:
- case FLAC__FILE_DECODER_ERROR_OPENING_FILE:
- case FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR:
- case FLAC__FILE_DECODER_SEEK_ERROR:
- case FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR:
- case FLAC__FILE_DECODER_ALREADY_INITIALIZED:
- case FLAC__FILE_DECODER_INVALID_CALLBACK:
- case FLAC__FILE_DECODER_UNINITIALIZED:
- squash_error( "Unable to initialize decoder: %s", FLAC__FileDecoderStateString[ state ] );
+ default:
+ squash_error( "Unable to initialize decoder: %s", FLAC__StreamDecoderInitStatusString[ state ] );
break;
}
- FLAC__file_decoder_process_until_end_of_metadata( decoder );
+ FLAC__stream_decoder_process_until_end_of_metadata( decoder );
- FLAC__file_decoder_finish( decoder );
- FLAC__file_decoder_delete( decoder );
+ FLAC__stream_decoder_finish( decoder );
+ FLAC__stream_decoder_delete( decoder );
return;
}
@@ -223,29 +184,27 @@
frame_data_t flac_decode_frame( void *data ) {
flac_data_t *flac_data = (flac_data_t *)data;
frame_data_t frame_data;
- FLAC__FileDecoderState state;
+ FLAC__StreamDecoderState state;
- FLAC__file_decoder_process_single( flac_data->decoder );
+ FLAC__stream_decoder_process_single( flac_data->decoder );
frame_data.position = flac_data->position;
- state = FLAC__file_decoder_get_state( flac_data->decoder );
+ state = FLAC__stream_decoder_get_state( flac_data->decoder );
switch( state ) {
- case FLAC__FILE_DECODER_OK:
+ case FLAC__STREAM_DECODER_READ_FRAME:
frame_data.pcm_data = flac_data->buffer;
frame_data.pcm_size = flac_data->buffer_size;
break;
- case FLAC__FILE_DECODER_END_OF_FILE:
+ case FLAC__STREAM_DECODER_END_OF_STREAM:
frame_data.pcm_data = NULL;
frame_data.pcm_size = 0;
break;
- case FLAC__FILE_DECODER_ERROR_OPENING_FILE:
- case FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR:
- case FLAC__FILE_DECODER_SEEK_ERROR:
- case FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR:
- case FLAC__FILE_DECODER_ALREADY_INITIALIZED:
- case FLAC__FILE_DECODER_INVALID_CALLBACK:
- case FLAC__FILE_DECODER_UNINITIALIZED:
- squash_error("Error while decoding: %s", FLAC__FileDecoderStateString[ state ] );
+ case FLAC__STREAM_DECODER_OGG_ERROR:
+ case FLAC__STREAM_DECODER_SEEK_ERROR:
+ case FLAC__STREAM_DECODER_ABORTED:
+ case FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR:
+ case FLAC__STREAM_DECODER_UNINITIALIZED:
+ squash_error("Error while decoding: %s", FLAC__StreamDecoderStateString[ state ] );
break;
}
@@ -267,7 +226,7 @@
void flac_seek( void *data, long seek_time, long duration ) {
flac_data_t *flac_data = (flac_data_t *)data;
- FLAC__file_decoder_seek_absolute( flac_data->decoder, seek_time * (flac_data->sample_rate / 1000) );
+ FLAC__stream_decoder_seek_absolute( flac_data->decoder, seek_time * (flac_data->sample_rate / 1000) );
return;
}
@@ -277,9 +236,9 @@
void flac_close( void *data ) {
flac_data_t *flac_data = (flac_data_t *)data;
- FLAC__file_decoder_finish( flac_data->decoder );
+ FLAC__stream_decoder_finish( flac_data->decoder );
- FLAC__file_decoder_delete( flac_data->decoder );
+ FLAC__stream_decoder_delete( flac_data->decoder );
/* Free allocated storage */
squash_free( flac_data->buffer );

View File

@ -7,6 +7,7 @@
PORTNAME= vorbis-tools
PORTVERSION= 1.2.0
PORTREVISION= 1
PORTEPOCH= 3
CATEGORIES= audio
MASTER_SITES= http://downloads.xiph.org/releases/vorbis/
@ -16,7 +17,7 @@ COMMENT= Play, encode, and manage Ogg Vorbis files
LIB_DEPENDS= ao.3:${PORTSDIR}/audio/libao \
curl.4:${PORTSDIR}/ftp/curl \
FLAC.7:${PORTSDIR}/audio/flac \
FLAC.10:${PORTSDIR}/audio/flac \
speex.1:${PORTSDIR}/audio/speex \
vorbis.4:${PORTSDIR}/audio/libvorbis

View File

@ -7,7 +7,7 @@
PORTNAME= xmcd
PORTVERSION= 3.3.2
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= audio
MASTER_SITES= http://www.ibiblio.org/tkan/download/xmcd/3.3.2/src/
@ -15,7 +15,7 @@ MAINTAINER= eischen@vigrid.com
COMMENT= Motif CD player
LIB_DEPENDS+= vorbis.4:${PORTSDIR}/audio/libvorbis \
FLAC.7:${PORTSDIR}/audio/flac
FLAC.10:${PORTSDIR}/audio/flac
RUN_DEPENDS+= lame:${PORTSDIR}/audio/lame
USE_MOTIF= yes

519
audio/xmcd/files/patch-ak Normal file
View File

@ -0,0 +1,519 @@
--- cdda_d/if_flac.c.orig 2008-04-06 21:14:40.000000000 +0200
+++ cdda_d/if_flac.c 2008-04-06 22:11:17.000000000 +0200
@@ -57,7 +57,6 @@ typedef float FLAC__real;
#include <FLAC/format.h>
#include <FLAC/metadata.h>
#include <FLAC/stream_encoder.h>
-#include <FLAC/seekable_stream_encoder.h>
extern appdata_t app_data;
@@ -86,7 +85,6 @@ extern char *tagcomment; /* Tag commen
/* Container union for encoder instance pointers */
typedef union {
FLAC__StreamEncoder *st; /* Stream encoder */
- FLAC__SeekableStreamEncoder *sk; /* Seekable stream encoder */
} flac_desc_t;
@@ -153,76 +151,10 @@ if_flac_write_callback(
/*
- * if_flac_seekable_write_callback
- * FLAC seekable stream encoder write callback function
- *
- * Args:
- * skp - Seekable stream encoder instance descriptor
- * buf - Output data buffer
- * len - data length
- * samples - number of samples
- * frame - Current frame
- * client_data - Callback data
- *
- * Return:
- * FLAC__STREAM_ENCODER_WRITE_STATUS_OK - success
- * FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR - failure
- */
-/*ARGSUSED*/
-STATIC FLAC__StreamEncoderWriteStatus
-if_flac_seekable_write_callback(
- const FLAC__SeekableStreamEncoder *skp,
- const FLAC__byte *buf,
- unsigned int len,
- unsigned int samples,
- unsigned int frame,
- void *client_data
-)
-{
- gen_desc_t *gdp = (gen_desc_t *) client_data;
-
- if (buf == NULL || len == 0)
- /* Nothing to do */
- return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
-
- /* Write out the encoded data */
- gdp->flags |= GDESC_WRITEOUT;
- if (!gen_write_chunk(gdp, (byte_t *) buf, (size_t) len))
- return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
-
- return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
-}
-
-
-/*
* if_flac_metadata_callback
* FLAC stream encoder metadata callback function
*
* Args:
- * stp - Encoder instance descriptor
- * data - Metadata buffer
- * client_data - Callback data
- *
- * Return:
- * Nothing.
- */
-/*ARGSUSED*/
-STATIC void
-if_flac_metadata_callback(
- const FLAC__StreamEncoder *stp,
- const FLAC__StreamMetadata *meta,
- void *client_data
-)
-{
- /* Do nothing: can't seek on a pipe */
-}
-
-
-/*
- * if_flac_seek_callback
- * FLAC seekable stream encoder seek callback function
- *
- * Args:
* skp - Encoder instance descriptor
* data - Metadata buffer
* client_data - Callback data
@@ -231,9 +163,9 @@ if_flac_metadata_callback(
* Nothing.
*/
/*ARGSUSED*/
-STATIC FLAC__SeekableStreamEncoderSeekStatus
-if_flac_seek_callback(
- const FLAC__SeekableStreamEncoder *skp,
+STATIC FLAC__StreamEncoderSeekStatus
+if_flac_metadata_callback(
+ const FLAC__StreamEncoder *skp,
FLAC__uint64 offset,
void *client_data
)
@@ -244,9 +176,9 @@ if_flac_seek_callback(
val = (off_t) ASSIGN32(offset);
if (gen_seek(gdp, val, SEEK_SET))
- return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK;
+ return FLAC__STREAM_ENCODER_SEEK_STATUS_OK;
else
- return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_ERROR;
+ return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR;
}
@@ -635,16 +567,9 @@ if_flac_addmeta(gen_desc_t *gdp, flac_de
if (flac_mblks == 0)
return; /* No metadata to set */
- if ((gdp->flags & GDESC_ISPIPE) != 0) {
- ret = FLAC__stream_encoder_set_metadata(
- ufdp->st, flac_mlist, flac_mblks
- );
- }
- else {
- ret = FLAC__seekable_stream_encoder_set_metadata(
- ufdp->sk, flac_mlist, flac_mblks
- );
- }
+ ret = FLAC__stream_encoder_set_metadata(
+ ufdp->st, flac_mlist, flac_mblks
+ );
if (!ret) {
(void) strcpy(gdp->cdp->i->msgbuf,
"if_flac_addmeta: Failed setting metadata.");
@@ -655,7 +580,7 @@ if_flac_addmeta(gen_desc_t *gdp, flac_de
/*
* if_flac_encoder_setup
- * Create and set up the FLAC stream encoder (used for pipe output).
+ * Create and set up the FLAC stream encoder.
*
* Args:
* gdp - Pointer to the gen_desc_t structure
@@ -836,43 +761,12 @@ if_flac_encoder_setup(
/* Initialize and add metadata to FLAC output */
if_flac_addmeta(gdp, ufdp);
- /* Register write callback function */
- ret = FLAC__stream_encoder_set_write_callback(
- stp, if_flac_write_callback
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_encoder_setup: "
- "Failed setting write callback.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- /* Register metadata callback function */
- ret = FLAC__stream_encoder_set_metadata_callback(
- stp, if_flac_metadata_callback
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_encoder_setup: "
- "Failed setting metadata callback.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- /* Set callback argument */
- ret = FLAC__stream_encoder_set_client_data(stp, gdp);
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_encoder_setup: "
- "Failed setting client data.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
/* Initialize FLAC encoder */
- enc_state = FLAC__stream_encoder_init(stp);
- if (enc_state != FLAC__STREAM_ENCODER_OK) {
+ enc_state = FLAC__stream_encoder_init_stream(
+ stp, if_flac_write_callback, NULL, NULL,
+ if_flac_metadata_callback, gdp
+ );
+ if (enc_state != FLAC__STREAM_ENCODER_INIT_STATUS_OK) {
(void) sprintf(gdp->cdp->i->msgbuf,
"if_flac_encoder_setup: Encoder init error: %s",
FLAC__stream_encoder_get_resolved_state_string(stp)
@@ -908,271 +802,6 @@ if_flac_encoder_setup(
/*
- * if_flac_seekable_encoder_setup
- * Create and set up the FLAC seekable stream encoder (used for file
- * output).
- *
- * Args:
- * gdp - Pointer to the gen_desc_t structure
- * ufdp - Pointer to the flac_desc_t structure
- * pp - Pointer to the flac_parms_t structure
- *
- * Return:
- * TRUE - success
- * FALSE - failure
- */
-STATIC bool_t
-if_flac_seekable_encoder_setup(
- gen_desc_t *gdp,
- flac_desc_t *ufdp,
- flac_parms_t *pp
-)
-{
- FLAC__SeekableStreamEncoder *skp;
- FLAC__SeekableStreamEncoderState enc_state;
- FLAC__uint64 val;
- FLAC__bool ret;
-
- ufdp->sk = skp = FLAC__seekable_stream_encoder_new();
- if (skp == NULL) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "FLAC encoder instantiation failed.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- /* Set some basic parameters */
-
- ret = FLAC__seekable_stream_encoder_set_channels(skp, 2);
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting channels.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- ret = FLAC__seekable_stream_encoder_set_bits_per_sample(skp, 16);
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting bits per sample.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- ret = FLAC__seekable_stream_encoder_set_sample_rate(skp, 44100);
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting sample rate.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- val = ASSIGN64(gdp->datalen >> 2);
- ret = FLAC__seekable_stream_encoder_set_total_samples_estimate(
- skp, val
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting samples estimate.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- ret = FLAC__seekable_stream_encoder_set_streamable_subset(skp, TRUE);
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting streamable subset.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- ret = FLAC__seekable_stream_encoder_set_do_qlp_coeff_prec_search(
- skp, pp->qlp_srch
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting LP coefficient quantization search."
- );
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- /* Just use default for now
- ret = FLAC__seekable_stream_encoder_set_qlp_coeff_precision(skp, 0);
- */
-
- ret = FLAC__seekable_stream_encoder_set_verify(skp, pp->vfy_mode);
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting verify mode.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- ret = FLAC__seekable_stream_encoder_set_max_lpc_order(
- skp, pp->lpc_order
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting max LPC order.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- ret = FLAC__seekable_stream_encoder_set_blocksize(skp, pp->block_sz);
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting block size.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- ret = FLAC__seekable_stream_encoder_set_do_mid_side_stereo(
- skp, pp->mid_side
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting M/S stereo.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- ret = FLAC__seekable_stream_encoder_set_loose_mid_side_stereo(
- skp, pp->adap_ms
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting adaptive M/S stereo.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- if (pp->min_rpo >= 0) {
- ret = FLAC__seekable_stream_encoder_set_min_residual_partition_order(
- skp, (unsigned int) pp->min_rpo
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting minimum RPO.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
- }
-
- if (pp->max_rpo >= 0) {
- ret = FLAC__seekable_stream_encoder_set_max_residual_partition_order(
- skp, (unsigned int) pp->max_rpo
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting maximum RPO.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
- }
-
- ret = FLAC__seekable_stream_encoder_set_do_exhaustive_model_search(
- skp, pp->exh_srch
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting exhaustive model search.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- /* Initialize and add metadata to FLAC output */
- if_flac_addmeta(gdp, ufdp);
-
- /* Register write callback function */
- ret = FLAC__seekable_stream_encoder_set_write_callback(
- skp, if_flac_seekable_write_callback
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting write callback.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- /* Register seek callback function */
- ret = FLAC__seekable_stream_encoder_set_seek_callback(
- skp, if_flac_seek_callback
- );
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting seek callback.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- /* Set callback argument */
- ret = FLAC__seekable_stream_encoder_set_client_data(skp, gdp);
- if (!ret) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Failed setting client data.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- /* Initialize FLAC encoder */
- enc_state = FLAC__seekable_stream_encoder_init(skp);
- if (enc_state != FLAC__SEEKABLE_STREAM_ENCODER_OK) {
- (void) sprintf(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: Encoder init error: %s",
- FLAC__seekable_stream_encoder_get_resolved_state_string(skp)
- );
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- /* Allocate wide samples buffers for the two channels */
- fenc_buf[0] = (FLAC__int32 *) MEM_ALLOC(
- "fenc_buf0",
- (size_t) gdp->cdp->cds->chunk_bytes
- );
- if (fenc_buf[0] == NULL) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Out of memory.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
- fenc_buf[1] = (FLAC__int32 *) MEM_ALLOC(
- "fenc_buf1",
- (size_t) gdp->cdp->cds->chunk_bytes
- );
- if (fenc_buf[1] == NULL) {
- (void) strcpy(gdp->cdp->i->msgbuf,
- "if_flac_seekable_encoder_setup: "
- "Out of memory.");
- DBGPRN(DBG_SND)(errfp, "%s\n", gdp->cdp->i->msgbuf);
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
* if_flac_init
* Initialize FLAC encoder and set up encoding parameters
*
@@ -1300,10 +929,7 @@ if_flac_init(gen_desc_t *gdp)
}
/* Set up encoder */
- if ((gdp->flags & GDESC_ISPIPE) != 0)
- ret = if_flac_encoder_setup(gdp, ufdp, &parms);
- else
- ret = if_flac_seekable_encoder_setup(gdp, ufdp, &parms);
+ ret = if_flac_encoder_setup(gdp, ufdp, &parms);
return (ret);
}
@@ -1351,16 +977,9 @@ if_flac_encode_chunk(gen_desc_t *gdp, by
DBGPRN(DBG_SND)(errfp, "\nEncoding %d samples\n", samples);
- if ((gdp->flags & GDESC_ISPIPE) != 0) {
- ret = FLAC__stream_encoder_process(
- ufdp->st, (void *) fenc_buf, (unsigned int) samples
- );
- }
- else {
- ret = FLAC__seekable_stream_encoder_process(
- ufdp->sk, (void *) fenc_buf, (unsigned int) samples
- );
- }
+ ret = FLAC__stream_encoder_process(
+ ufdp->st, (void *) fenc_buf, (unsigned int) samples
+ );
if (!ret) {
(void) strcpy(gdp->cdp->i->msgbuf,
"if_flac_encode_chunk: Process encoding failed.");
@@ -1393,14 +1012,8 @@ if_flac_halt(gen_desc_t *gdp)
ufdp = (flac_desc_t *) gdp->aux;
- if ((gdp->flags & GDESC_ISPIPE) != 0) {
- FLAC__stream_encoder_finish(ufdp->st);
- FLAC__stream_encoder_delete(ufdp->st);
- }
- else {
- FLAC__seekable_stream_encoder_finish(ufdp->sk);
- FLAC__seekable_stream_encoder_delete(ufdp->sk);
- }
+ FLAC__stream_encoder_finish(ufdp->st);
+ FLAC__stream_encoder_delete(ufdp->st);
MEM_FREE(ufdp);
gdp->aux = NULL;

View File

@ -6,23 +6,20 @@
#
PORTNAME= xmms-flac
PORTVERSION= 1.1.2
PORTREVISION= 4
PORTVERSION= 1.2.1
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:S/$/:sf/} \
${MASTER_SITE_LOCAL:S/$/:local/}
MASTER_SITE_SUBDIR= flac/:sf naddy/:local
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= flac
DISTNAME= flac-${PORTVERSION}
DISTFILES= ${EXTRACT_ONLY}:sf flac-alloc.h:local
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= naddy@FreeBSD.org
COMMENT= XMMS input plugin for playing FLAC files
LIB_DEPENDS= xmms.4:${PORTSDIR}/multimedia/xmms \
FLAC.7:${PORTSDIR}/audio/flac
FLAC.10:${PORTSDIR}/audio/flac
USE_AUTOTOOLS= libtool:15
CONFIGURE_TARGET= --target=${ARCH}-unknown-freebsd${OSREL}
CONFIGURE_ARGS= --with-libiconv-prefix="${LOCALBASE}" \
--with-ogg="${LOCALBASE}" \
--with-xmms-prefix="${X11BASE}"
@ -30,9 +27,6 @@ MAKE_ARGS= LIBTOOL="${LIBTOOL} --tag=disable-static"
MAKE_ENV= MAKEOBJDIR=/nonexistent # ignore ${WRKSRC}/obj
MAKEFILE= ${FILESDIR}/Makefile
post-extract:
@${CP} ${DISTDIR}/flac-alloc.h ${WRKSRC}/include/share/alloc.h
# XXX
post-install:
${RM} ${PREFIX}/lib/xmms/Input/libxmms-flac.la

View File

@ -1,6 +1,3 @@
MD5 (flac-1.1.2.tar.gz) = 2bfc127cdda02834d0491ab531a20960
SHA256 (flac-1.1.2.tar.gz) = ce4f7d11b3c04a7368c916ca4abc284dd0c0256f461dfb7f07df1ab445e7a5c0
SIZE (flac-1.1.2.tar.gz) = 1516235
MD5 (flac-alloc.h) = 08891390039e2aee9bd4335f784467db
SHA256 (flac-alloc.h) = da40afc663e5b3fe6dccd1a0f1c218b7ec02d3699d72b41d6978696896d7df98
SIZE (flac-alloc.h) = 5697
MD5 (flac-1.2.1.tar.gz) = 153c8b15a54da428d1f0fadc756c22c7
SHA256 (flac-1.2.1.tar.gz) = 9635a44bceb478bbf2ee8a785cf6986fba525afb5fad1fd4bba73cf71f2d3edf
SIZE (flac-1.2.1.tar.gz) = 2009217

View File

@ -3,15 +3,12 @@ $FreeBSD$
--- configure.orig
+++ configure
@@ -10541,9 +10541,9 @@
if test x$debug = xtrue; then
OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
else
- OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O2 -DNDEBUG"
+ OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -DNDEBUG"
if test x$GCC = xyes; then
- OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__"
+ OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -Wall -W -DFLaC__INLINE=__inline__"
@@ -23490,7 +23490,7 @@
CPPFLAGS="-DNDEBUG $CPPFLAGS"
if test "x$GCC" = xyes; then
CPPFLAGS="-DFLaC__INLINE=__inline__ $CPPFLAGS"
- CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS"
+ CFLAGS="-Wall -W $CFLAGS"
fi
fi
CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"

View File

@ -1,25 +0,0 @@
$FreeBSD$
--- src/plugin_common/charset.c.orig
+++ src/plugin_common/charset.c
@@ -83,6 +83,8 @@
/* Due to a GLIBC bug, round outbuf_size up to a multiple of 4 */
/* + 1 for nul in case len == 1 */
outsize = ((length + 3) & ~3) + 1;
+ if(outsize < length) /* overflow check */
+ return NULL;
out = (char*)malloc(outsize);
outleft = outsize - 1;
outptr = out;
@@ -95,6 +97,10 @@
{
case E2BIG:
used = outptr - out;
+ if((outsize - 1) * 2 + 1 <= outsize) { /* overflow check */
+ free(out);
+ return NULL;
+ }
outsize = (outsize - 1) * 2 + 1;
out = realloc(out, outsize);
outptr = out + used;

View File

@ -1,59 +0,0 @@
$FreeBSD$
--- src/plugin_common/tags.c.orig
+++ src/plugin_common/tags.c
@@ -23,6 +23,7 @@
#include "tags.h"
#include "FLAC/assert.h"
#include "FLAC/metadata.h"
+#include "share/alloc.h"
static __inline unsigned local__wide_strlen(const FLAC__uint16 *s)
@@ -82,7 +83,7 @@
}
/* allocate */
- out = (FLAC__uint16*)malloc(chars * sizeof(FLAC__uint16));
+ out = (FLAC__uint16*)safe_malloc_mul_2op_(chars, /*times*/sizeof(FLAC__uint16));
if (0 == out) {
FLAC__ASSERT(0);
return 0;
@@ -130,19 +131,23 @@
static char *local__convert_ucs2_to_utf8(const FLAC__uint16 *src, unsigned length)
{
char *out;
- unsigned len = 0;
+ unsigned len = 0, n;
FLAC__ASSERT(0 != src);
/* calculate length */
{
unsigned i;
- for (i = 0; i < length; i++)
- len += local__ucs2len(src[i]);
+ for (i = 0; i < length; i++) {
+ n += local__ucs2len(src[i]);
+ if(len + n < len) /* overflow check */
+ return 0;
+ len += n;
+ }
}
/* allocate */
- out = (char*)malloc(len * sizeof(char));
+ out = (char*)safe_malloc_mul_2op_(len, /*times*/sizeof(char));
if (0 == out)
return 0;
@@ -265,7 +270,7 @@
const size_t value_len = strlen(value);
const size_t separator_len = strlen(separator);
FLAC__byte *new_entry;
- if(0 == (new_entry = (FLAC__byte*)realloc(entry->entry, entry->length + value_len + separator_len + 1)))
+ if(0 == (new_entry = (FLAC__byte*)safe_realloc_add_4op_(entry->entry, entry->length, /*+*/value_len, /*+*/separator_len, /*+*/1)))
return false;
memcpy(new_entry+entry->length, separator, separator_len);
entry->length += separator_len;

View File

@ -3,7 +3,26 @@ $FreeBSD$
--- src/plugin_xmms/Makefile.in.orig
+++ src/plugin_xmms/Makefile.in
@@ -77,8 +77,7 @@
@@ -147,7 +147,7 @@
LIBS = @LIBS@
# Don't build a static library
-LIBTOOL = $(top_builddir)/libtool-disable-static
+LIBTOOL = @LIBTOOL@ --tag=disable-static
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@@ -264,8 +264,7 @@
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
$(top_builddir)/src/share/utf8/libutf8.la \
- $(top_builddir)/src/libFLAC/libFLAC.la \
- -L$(top_builddir)/src/libFLAC/.libs \
+ -lFLAC \
@OGG_LIBS@ \
@XMMS_LIBS@ \
@LIBICONV@
@@ -283,8 +282,7 @@
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
@ -13,22 +32,3 @@ $FreeBSD$
am__objects_1 = charset.lo configure.lo fileinfo.lo http.lo plugin.lo \
tag.lo
am_libxmms_flac_la_OBJECTS = $(am__objects_1)
@@ -189,7 +188,7 @@
LIBS = @LIBS@
# Don't build a static library
-LIBTOOL = $(top_builddir)/libtool-disable-static
+LIBTOOL = @LIBTOOL@ --tag=disable-static
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
@@ -296,8 +295,7 @@
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
$(top_builddir)/src/share/utf8/libutf8.la \
- $(top_builddir)/src/libFLAC/libFLAC.la \
- -L$(top_builddir)/src/libFLAC/.libs \
+ -lFLAC \
@XMMS_LIBS@ \
@LIBICONV@

View File

@ -1,16 +0,0 @@
$FreeBSD$
--- src/plugin_xmms/http.c.orig
+++ src/plugin_xmms/http.c
@@ -44,10 +44,6 @@
#include "FLAC/format.h"
#include "plugin.h"
-#ifndef HAVE_SOCKLEN_T
-typedef unsigned int socklen_t;
-#endif
-
#define min(x,y) ((x)<(y)?(x):(y))
#define min3(x,y,z) (min(x,y)<(z)?min(x,y):(z))
#define min4(x,y,z,w) (min3(x,y,z)<(w)?min3(x,y,z):(w))

View File

@ -1,34 +0,0 @@
$FreeBSD$
--- src/plugin_xmms/plugin.c.orig
+++ src/plugin_xmms/plugin.c
@@ -259,6 +259,12 @@
/* stream */
+ /* XXX allow indiscriminate use of g_free() */
+ flac_cfg.stream.proxy_host = g_strdup("");
+ flac_cfg.stream.proxy_user = g_strdup("");
+ flac_cfg.stream.proxy_pass = g_strdup("");
+ flac_cfg.stream.save_http_path = g_strdup("");
+
xmms_cfg_read_int(cfg, "flac", "stream.http_buffer_size", &flac_cfg.stream.http_buffer_size);
xmms_cfg_read_int(cfg, "flac", "stream.http_prebuffer", &flac_cfg.stream.http_prebuffer);
xmms_cfg_read_boolean(cfg, "flac", "stream.use_proxy", &flac_cfg.stream.use_proxy);
@@ -425,8 +431,13 @@
if(title) {
if (source_to_decoder_type (filename) == DECODER_FILE) {
static const char *errtitle = "Invalid FLAC File: ";
- *title = g_malloc(strlen(errtitle) + 1 + strlen(filename) + 1 + 1);
- sprintf(*title, "%s\"%s\"", errtitle, filename);
+ if(strlen(errtitle) + 1 + strlen(filename) + 1 + 1 < strlen(filename)) { /* overflow check */
+ *title = NULL;
+ }
+ else {
+ *title = g_malloc(strlen(errtitle) + 1 + strlen(filename) + 1 + 1);
+ sprintf(*title, "%s\"%s\"", errtitle, filename);
+ }
} else {
*title = NULL;
}

View File

@ -1,22 +0,0 @@
$FreeBSD$
--- src/share/utf8/charset.c.orig
+++ src/share/utf8/charset.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
+#include "share/alloc.h"
#include "charset.h"
#include "charmaps.h"
@@ -492,7 +493,7 @@
if (!charset1 || !charset2 )
return -1;
- tobuf = (char *)malloc(fromlen * charset2->max + 1);
+ tobuf = (char *)safe_malloc_mul2add_(fromlen, /*times*/charset2->max, /*+*/1);
if (!tobuf)
return -2;

View File

@ -1,49 +0,0 @@
$FreeBSD$
--- src/share/utf8/iconvert.c.orig
+++ src/share/utf8/iconvert.c
@@ -27,6 +27,7 @@
#include <iconv.h>
#include <stdlib.h>
#include <string.h>
+#include "share/alloc.h"
/*
* Convert data from one encoding to another. Return:
@@ -79,7 +80,7 @@
* This is deliberately not a config option as people often
* change their iconv library without rebuilding applications.
*/
- tocode1 = (char *)malloc(strlen(tocode) + 11);
+ tocode1 = (char *)safe_malloc_add_2op_(strlen(tocode), /*+*/11);
if (!tocode1)
goto fail;
@@ -117,6 +118,8 @@
break;
if (obl < 6) {
/* Enlarge the buffer */
+ if(utflen*2 < utflen) /* overflow check */
+ goto fail;
utflen *= 2;
newbuf = (char *)realloc(utfbuf, utflen);
if (!newbuf)
@@ -143,7 +146,7 @@
iconv_close(cd1);
return ret;
}
- newbuf = (char *)realloc(utfbuf, (ob - utfbuf) + 1);
+ newbuf = (char *)safe_realloc_add_2op_(utfbuf, (ob - utfbuf), /*+*/1);
if (!newbuf)
goto fail;
ob = (ob - utfbuf) + newbuf;
@@ -194,7 +197,7 @@
outlen += ob - tbuf;
/* Convert from UTF-8 for real */
- outbuf = (char *)malloc(outlen + 1);
+ outbuf = (char *)safe_malloc_add_2op_(outlen, /*+*/1);
if (!outbuf)
goto fail;
ib = utfbuf;

View File

@ -1,72 +0,0 @@
$FreeBSD$
--- src/share/utf8/utf8.c.orig
+++ src/share/utf8/utf8.c
@@ -28,6 +28,7 @@
#include <config.h>
#endif
+#include "share/alloc.h"
#include "utf8.h"
#include "charset.h"
@@ -57,10 +58,13 @@
} else {
size += 3;
}
+ if(size+n < size) /* overflow check */
+ return NULL;
+ size += n;
c = unicode[index++];
}
- out = malloc(size + 1);
+ out = safe_malloc_add_2op_(size, /*+*/1);
if (out == NULL)
return NULL;
index = 0;
@@ -101,11 +105,15 @@
} else {
index += 1;
}
+ if(size + 1 == 0) /* overflow check */
+ return NULL;
size += 1;
c = utf8[index++];
}
- out = malloc((size + 1) * sizeof(wchar_t));
+ if(size + 1 == 0) /* overflow check */
+ return NULL;
+ out = safe_malloc_mul_2op_((size + 1), /*times*/sizeof(wchar_t));
if (out == NULL)
return NULL;
index = 0;
@@ -147,7 +155,7 @@
return -1;
}
- unicode = calloc(wchars + 1, sizeof(unsigned short));
+ unicode = safe_calloc_(wchars + 1, sizeof(unsigned short));
if(unicode == NULL)
{
fprintf(stderr, "Out of memory processing string to UTF8\n");
@@ -197,7 +205,7 @@
return -1;
}
- *to = calloc(chars + 1, sizeof(unsigned char));
+ *to = safe_calloc_(chars + 1, sizeof(unsigned char));
if(*to == NULL)
{
fprintf(stderr, "Out of memory processing string to local charset\n");
@@ -285,7 +293,7 @@
if (ret != -1)
return ret;
- s = malloc(fromlen + 1);
+ s = safe_malloc_add_2op_(fromlen, /*+*/1);
if (!s)
return -1;
strcpy(s, from);

View File

@ -8,6 +8,7 @@
PORTNAME?= xmms2
PORTVERSION= 0.4.d.0
DISTVERSION= 0.4DrKosmos
PORTREVISION= 1
CATEGORIES?= audio
MASTER_SITES= SF
DISTNAME= ${PORTNAME}-${DISTVERSION}
@ -112,7 +113,7 @@ PLIST_SUB+= SID="@comment "
.endif
.if !defined(WITHOUT_FLAC)
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
PLIST_SUB+= FLAC=""
.else
EXCLUDE+= --without-plugins="flac"

View File

@ -7,6 +7,7 @@
PORTNAME= scummvm
PORTVERSION= 0.11.1
PORTREVISION= 1
CATEGORIES= games emulators
MASTER_SITES= SF
@ -67,7 +68,7 @@ CONFIGURE_ARGS+=--disable-mpeg2
.endif
.if defined(WITH_FLAC)
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
CONFIGURE_ARGS+=--with-flac-prefix=${LOCALBASE}
.else
CONFIGURE_ARGS+=--disable-flac

View File

@ -7,7 +7,7 @@
PORTNAME= vavoom
PORTVERSION= 1.26
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= games
MASTER_SITES= SF
@ -67,7 +67,7 @@ PLIST_SUB+= EDITING="@comment "
.endif
.if defined(WITH_FLAC)
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
CONFIGURE_ARGS+=--with-flac
.else
CONFIGURE_ARGS+=--without-flac

View File

@ -7,6 +7,7 @@
PORTNAME= audacious-plugins
PORTVERSION= 1.5.0
PORTREVISION= 1
CATEGORIES= multimedia audio
MASTER_SITES= http://distfiles.atheme.org/
EXTRACT_SUFX= .tgz
@ -184,7 +185,7 @@ PLIST_SUB+= VORBISPLUGIN="@comment "
.endif
.if defined(WITH_FLAC)
LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
CONFIGURE_ARGS+=--enable-flacng --enable-filewriter_flac
PLIST_SUB+= FLACPLUGIN=""
.else

View File

@ -208,7 +208,7 @@ gst_faad_LIB_DEPENDS+= faad.0:${PORTSDIR}/audio/faad
gst_faad_DIST= bad
# flac
gst_flac_LIB_DEPENDS+= FLAC.7:${PORTSDIR}/audio/flac
gst_flac_LIB_DEPENDS+= FLAC.10:${PORTSDIR}/audio/flac
# gconf
gst_gconf_USE_GNOME+= gnomeprefix gconf2

View File

@ -8,7 +8,7 @@
PORTNAME= kdemultimedia
PORTVERSION= ${KDE_VERSION}
PORTREVISION= 0
PORTREVISION= 1
CATEGORIES= multimedia kde
MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= stable/${PORTVERSION:S/.0//}/src
@ -33,7 +33,7 @@ PREFIX= ${KDE_PREFIX}
USE_BZIP2= yes
USE_GMAKE= yes
USE_AUTOTOOLS= libtool:15
USE_AUTOTOOLS= autoconf:261:env libtool:15
MAKE_ENV= ${CONFIGURE_ENV}
@ -42,6 +42,9 @@ CONFIGURE_ENV+= AKODE_CONFIG=${LOCALBASE}/bin/akode-config
USE_LDCONFIG= yes
LDCONFIG_DIRS+= %%PREFIX%%/lib %%PREFIX%%/lib/kde3
DO_NOT_COMPILE+=akode juk mpeglib mpeglib_artsplug xine_artsplugin
# short-circuit auto frameworks rebuilds
MAKE_ARGS= ACLOCAL="${TRUE}" AUTOCONF="${TRUE}" AUTOMAKE="${TRUE}" \
AUTOHEADER="${TRUE}"
OPTIONS= AKODE "Use akode for audio playback" on \
MPEGLIB "Use mpeglib for audio playback" off \
@ -72,6 +75,8 @@ CONFIGURE_ENV+= DO_NOT_COMPILE="${DO_NOT_COMPILE}"
pre-configure:
${REINPLACE_CMD} -e "s,applications-merged,kde-applications-merged,g" \
${WRKSRC}/kappfinder-data/Makefile.in
@cd ${CONFIGURE_WRKSRC} \
&& ${SETENV} ${AUTOTOOLS_ENV} ${AUTOCONF} ${AUTOCONF_ARGS}
post-install:
@${CAT} ${PKGMESSAGE}

Some files were not shown because too many files have changed in this diff Show More