Displaying 20 results from an estimated 65 matches for "flac__byte".
2005 Aug 01
1
Application Metadata
...ing
of characters, which doesn't need to be null-terminated.
I've looked through the docs, i've looked through the tests, and sorry
to say, but I just Don't Get It.
Based on some of the test code, I had assumed I would do something like:
FLAC::Metadata::Application header_flac;
FLAC__byte header_flac_id[4] = { 1, 2, 3, 4 };
header_flac.set_id(header_flac_id);
header_flac.set_data((FLAC__byte*)(header_str.begin()),header_str.size());
// set the metadata
FLAC::Metadata::Prototype *metadata_sequence[] = { &header_flac };
enc.set_metadata(metadata_sequence,sizeof(metadata_sequence)...
2007 Aug 24
0
Fixes to make flac build on Solaris
...6 *s)
>> {
>> unsigned n = 0;
>> while(*s++)
>> @@ -43,7 +43,7 @@
>> * and a more clear explanation at the end of this section:
>> * http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
>> */
>> -static __inline unsigned local__utf8len(const FLAC__byte *utf8)
>> +static inline unsigned local__utf8len(const FLAC__byte *utf8)
>> {
>> FLAC__ASSERT(0 != utf8);
>> if ((utf8[0] & 0x80) == 0) {
>> @@ -85,7 +85,7 @@
>> }
>>
>>
>> -static __inline unsigned local__utf8_to_ucs2(const FLAC__...
2014 May 04
0
Building FLAC with LTO
...1.3.0/src/libFLAC/include/private/ogg_mapping.h 2014-05-03 09:05:25.669393200 +0000
@@ -38,27 +38,28 @@
/** The length of the packet type field in bytes. */
#define FLAC__OGG_MAPPING_PACKET_TYPE_LENGTH (1u)
-extern const unsigned FLAC__OGG_MAPPING_PACKET_TYPE_LEN; /* = 8 bits */
-
-extern const FLAC__byte FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE; /* = 0x7f */
-
/** The length of the 'FLAC' magic in bytes. */
#define FLAC__OGG_MAPPING_MAGIC_LENGTH (4u)
-extern const FLAC__byte * const FLAC__OGG_MAPPING_MAGIC; /* = "FLAC" */
-
-extern const unsigned FLAC__OGG_MAPPING_VERSION_MA...
2006 May 11
2
C++ Set_Metadata Problem
...tadata block looked right, but it did not work for him. I have tried
the same and also can not get it to work, but with a different error.
To recap... (I've left out is-valid checks in the listing for brevity)
//////////
// Create an application block
FLAC::Metadata::Application header_flac;
FLAC__byte header_flac_id[4] = { 1, 2, 3, 4 };
header_flac.set_id(header_flac_id);
header_flac.set_data((FLAC__byte*)(header_str.begin()),header_str.size()
);
// Add the block to a metadata array and pass the array to the encoder
object
FLAC::Metadata::Prototype *meta[] = { &header_flac };
set_metadata(m...
2011 May 30
1
64-bit FLAC structure sizes and padding
...t and it works without any issues. This now leave me a bit
confused, since it should have issues(!).
Using the MS 64-bit compiler on Windows 7/2008R2 64-bit. Static libFLAC
compiled with compiler default 8 byte boundary alignment.
Now consider this:
typedef struct {
FLAC__uint32 length;
FLAC__byte *entry;
} FLAC__StreamMetadata_VorbisComment_Entry;
The compiler (with default settings) should interpret this as
typedef struct {
FLAC__uint32 length;
uint32_t __padding;
FLAC__byte *entry;
} FLAC__StreamMetadata_VorbisComment_Entry;
Sizeof structure: 32-bit - 8 bytes, 64-bit - 16...
2007 Sep 12
0
Changes to include/FLAC/metadata.h
...le recently changed from:
FLAC_API FLAC__bool
FLAC__metadata_object_picture_set_mime_type (FLAC__StreamMetadata *object,
const char *mime_type, FLAC__bool copy);
FLAC_API FLAC__bool
FLAC__metadata_object_picture_set_description(FLAC__StreamMetadata *object,
const FLAC__byte *description, FLAC__bool copy);
to:
FLAC_API FLAC__bool
FLAC__metadata_object_picture_set_mime_type (FLAC__StreamMetadata *object,
char *mime_type, FLAC__bool copy);
FLAC_API FLAC__bool
FLAC__metadata_object_picture_set_description(FLAC__StreamMetadata *object,...
2012 May 05
5
[PATCH] Optionally, allow distros to use openssl for MD5 verification
...SSL)
+#include <openssl/evp.h>
+#define FLAC__MD5Context EVP_MD_CTX
+#else
+#define EVP_MAX_MD_SIZE 16
typedef struct {
FLAC__uint32 in[16];
FLAC__uint32 buf[4];
@@ -37,7 +42,8 @@ typedef struct {
} FLAC__MD5Context;
void FLAC__MD5Init(FLAC__MD5Context *context);
-void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *context);
+void FLAC__MD5Final(FLAC__byte digest[EVP_MAX_MD_SIZE], FLAC__MD5Context *context);
+#endif
FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const signal[], unsigned channels, unsigned samples, unsigned bytes_per_sample);
diff -...
2011 Sep 28
0
FLAC::Encoder::Stream == "FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA"
...**********************************************************************/
class TMyFlacEncoder: public FLAC::Encoder::Stream {
protected:
TMyFileAccess *FFile; // the file we are writing to
long long FFlacOffset;
virtual FLAC__StreamEncoderReadStatus read_callback (FLAC__byte
buffer[], size_t *bytes)
{
if(*bytes > 0) {
*bytes = FFile->Read(buffer, sizeof(FLAC__byte), *bytes);
if(FFile->Error())
return FLAC__STREAM_ENCODER_READ_STATUS_ABORT;
else if(*bytes == 0)...
2011 May 30
2
64-bit FLAC structure sizes and padding
> Err, no it wouldn't. In fact this example you gave only confuses
> the matter.
? What do you mean?
typedef struct {
FLAC__uint32 length;
FLAC__byte *entry;
} FLAC__StreamMetadata_VorbisComment_Entry;
Can you confirm that the entry member is a pointer and not a byte array?
In that case:
What happens if the compiler expands the size of the structure twice (8=>16
bytes)?
I did some debugging to examine the structure sizes but I'm not qu...
2014 Aug 14
1
Encoder example for 24-bit files
...b/examples/c/encode/file/main.c
@@ -40,8 +40,10 @@ static void progress_callback(const
FLAC__StreamEncoder *encoder, FLAC__uint64 b
#define READSIZE 1024
+#define BPS 24 /* Bits per sample */
+
static unsigned total_samples = 0; /* can use a 32-bit number due to
WAVE size limitations */
-static FLAC__byte buffer[READSIZE/*samples*/ * 2/*bytes_per_sample*/
* 2/*channels*/]; /* we read the WAVE data into here */
+static FLAC__byte buffer[READSIZE/*samples*/ * BPS/8
/*bytes_per_sample*/ * 2/*channels*/]; /* we read the WAVE data into
here */
static FLAC__int32 pcm[READSIZE/*samples*/ * 2/*channels*/];...
2013 Apr 20
2
Metaflac hex dump UTF-8 and locale fix
...b/src/metaflac/utils.c
@@ -77,17 +77,23 @@ void local_strcat(char **dest, const char *source)
safe_strncpy((*dest)+ndest, source, ndest + nsource + 1);
}
+static inline int local_isprint(int c)
+{
+ if (c < 0x32) return 0;
+ return isprint(c);
+}
+
void hexdump(const char *filename, const FLAC__byte *buf, unsigned bytes, const char *indent)
{
unsigned i, left = bytes;
const FLAC__byte *b = buf;
for(i = 0; i < bytes; i += 16) {
- flac_printf("%s%s%s%08X: "
+ flac_printf("%s%s", filename? filename:"", filename? ":":"");
+ printf(&q...
2008 Nov 06
2
libFLAC header checking
In stream_decoder.c function find_metadata_() checks whether a file is
valid or not. There are 4 cases it recognizes:
1) file begins with 'fLaC'
2) file begins with ID3 (skipped), followed by 'fLaC'
3) file may begin with 11111111 111110?? sync code (or 11111111111110,
depends on endianess i suppose). That is - a raw file with FLAC frames,
without header (right?).
4) file begins
2014 Aug 14
6
Encoder example for 24-bit files
...Here's the diff:
Index: main.c
===================================================================
--- main.c (revision 1)
+++ main.c (working copy)
@@ -39,7 +39,7 @@
#define READSIZE 1024
static unsigned total_samples = 0; /* can use a 32-bit number due to
WAVE size limitations */
-static FLAC__byte buffer[READSIZE/*samples*/ * 2/*bytes_per_sample*/
* 2/*channels*/]; /* we read the WAVE data into here */
+static FLAC__byte buffer[READSIZE/*samples*/ * 3/*bytes_per_sample*/
* 2/*channels*/]; /* we read the WAVE data into here */
static FLAC__int32 pcm[READSIZE/*samples*/ * 2/*channels*/];
in...
2004 Sep 10
1
mistake in FLAC++ metadata interface?
...eet *)
It returns a bool instead of an int, why is this?
To get the mumber of indicies in a track I need to use:
cuesheet->get_track(i).get_track()->num_indices;
ie. retrieve the C struct and get it from there.
Is this a mistake in include/FLAC++/metadata.h ?
ie should line 609 be:
inline FLAC__byte get_num_indices() const { return object_->num_indices;
}
rather than:
inline bool get_num_indices() const { return object_->num_indices; }
?
thanks,
Dave
--
David Collett <jg@webone.com.au>
2004 Sep 28
2
Finding start of audio data using metadata level 2 interface.
...data block type
> read 3 byte metadata block length
> is_last = type & 0x80
> fseek(file,length,SEEK_CUR)
>}
>last_offset=ftell(file)
>
>see also:
> http://flac.sourceforge.net/format.html#metadata_block_header
>'length' is big-endian
Should type be of FLAC__byte, and length of FLAC__uint32? I'm not having much
luck here.. (not a C programmer by nature).
-D
--
This movie has warped my fragile little mind.
2005 Apr 01
1
bug in xmms plugin v 1.1.2
...otice of
whoever added the streaming support, which is where this was introduced.
(BTW, thank you for the streaming support.)
------- plugin.c -------
--- /tmp/sccs.zza4YF Thu Mar 31 20:03:46 2005
+++ plugin.c Mon Mar 28 19:58:20 2005
@@ -219,6 +219,12 @@
is_big_endian_host_ = (*((FLAC__byte*)(&test)))? false : true;
+ /* make all the config struct strings dynamic, to ease our life */
+ flac_cfg.stream.proxy_host = g_strdup(flac_cfg.stream.proxy_host);
+ flac_cfg.stream.proxy_user = g_strdup(flac_cfg.stream.proxy_user);
+ flac_cfg.stream.proxy_pass = g_strd...
2010 Mar 08
0
Difficulties in add cover art to FLAC file
...etadata_object_picture_is_legal,
I got a "fail to write: status 0" message.
picture->data.picture.type = (FLAC__StreamMetadata_Picture_Type)3;
FLAC__metadata_object_picture_set_mime_type( picture, "image/jpeg", true );
FLAC__metadata_object_picture_set_description( picture,
(FLAC__byte*)"", true );
CFile picfile;
picfile.Open( L"I:\\1.jpg", CFile::modeRead | CFile::shareDenyWrite);
ULONGLONG dwLength = picfile.GetLength();
LPSTR pData = new char[static_cast<unsigned int>(dwLength+1)];
picfile.Read(pData, static_cast<UINT>(dwLength));
FLAC__metada...
2015 Aug 22
1
[PATCH] for md5.c
Eric, your last patches brought my attention to md5.c, and I noticed
that the code in it (both old and current versions) can set
ctx->internal_buf.p8 to 0, but leave ctx->capacity unchanged.
IMHO it makes sense to update this variable too.
Also, 'FLAC__byte* tmp' variable is unnecessary now.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: md5_alloc.patch
Type: application/octet-stream
Size: 736 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20150822/03129942/attachment.obj
2008 Dec 10
0
libFLAC header checking
...rom magic number second 0 is from
reserved bit that should always be 0)
In MP3 it must not be 00 (00 is reserved).
Suggested code change is
from:
else if(x >> 2 == 0x3e) { /* MAGIC NUMBER for the last 6
sync bits */
decoder->private_->header_warmup[1] = (FLAC__byte)x;
decoder->protected_->state =
FLAC__STREAM_DECODER_READ_FRAME;
return true;
}
to
else if(x >> 1 == 0x7c) { /* MAGIC NUMBER for the last 6
sync bits and reserved 7th bit*/
decoder->private_->header_war...
2012 Apr 05
2
[PATCH 2/2] V2: Use a single definition of MIN and MAX in sources
...macros.h"
/****************************************************************************
*
@@ -2634,7 +2625,7 @@ FLAC__bool write_metadata_block_data_vorbis_comment_cb_(FLAC__IOHandle handle, F
const unsigned num_comments_len = FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN / 8;
FLAC__byte buffer[4]; /* magic number is asserted below */
- FLAC__ASSERT(max(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN, FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN) / 8 == sizeof(buffer));
+ FLAC__ASSERT(flac_max(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN, FLAC__STREAM_META...