diff --git a/flac-1.2.1-asm.patch b/flac-1.2.1-asm.patch deleted file mode 100644 index 661260c..0000000 --- a/flac-1.2.1-asm.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff -up flac-1.2.1/src/libFLAC/stream_decoder.c.asm flac-1.2.1/src/libFLAC/stream_decoder.c ---- flac-1.2.1/src/libFLAC/stream_decoder.c.asm 2007-09-13 17:38:05.000000000 +0200 -+++ flac-1.2.1/src/libFLAC/stream_decoder.c 2008-01-29 10:32:17.000000000 +0100 -@@ -421,7 +421,7 @@ static FLAC__StreamDecoderInitStatus ini - #ifdef FLAC__CPU_IA32 - FLAC__ASSERT(decoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32); - #ifdef FLAC__HAS_NASM --#if 1 /*@@@@@@ OPT: not clearly faster, needs more testing */ -+#if 0 /*@@@@@@ OPT: not clearly faster, needs more testing */ - if(decoder->private_->cpuinfo.data.ia32.bswap) - decoder->private_->local_bitreader_read_rice_signed_block = FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap; - #endif -diff -up flac-1.2.1/src/libFLAC/ia32/lpc_asm.nasm.asm flac-1.2.1/src/libFLAC/ia32/lpc_asm.nasm ---- flac-1.2.1/src/libFLAC/ia32/lpc_asm.nasm.asm 2007-03-22 05:13:05.000000000 +0100 -+++ flac-1.2.1/src/libFLAC/ia32/lpc_asm.nasm 2008-01-29 10:34:09.000000000 +0100 -@@ -1507,5 +1507,5 @@ cident FLAC__lpc_restore_signal_asm_ia32 - end - - %ifdef OBJ_FORMAT_elf -- section .note.GNU-stack noalloc -+ section .note.GNU-stack progbits noalloc noexec nowrite align=1 - %endif -diff -up flac-1.2.1/src/libFLAC/ia32/Makefile.am.asm flac-1.2.1/src/libFLAC/ia32/Makefile.am ---- flac-1.2.1/src/libFLAC/ia32/Makefile.am.asm 2007-04-04 02:01:13.000000000 +0200 -+++ flac-1.2.1/src/libFLAC/ia32/Makefile.am 2008-03-17 14:04:37.000000000 +0100 -@@ -37,7 +37,6 @@ STRIP_NON_ASM = sh $(top_srcdir)/strip_n - - noinst_LTLIBRARIES = libFLAC-asm.la - libFLAC_asm_la_SOURCES = \ -- bitreader_asm.nasm \ - cpu_asm.nasm \ - fixed_asm.nasm \ - lpc_asm.nasm \ -diff -up flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm.asm flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm ---- flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm.asm 2007-03-30 02:54:53.000000000 +0200 -+++ flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm 2008-01-29 10:32:57.000000000 +0100 -@@ -564,5 +564,5 @@ cident FLAC__bitreader_read_rice_signed_ - end - - %ifdef OBJ_FORMAT_elf -- section .note.GNU-stack noalloc -+ section .note.GNU-stack progbits noalloc noexec nowrite align=1 - %endif -diff -up flac-1.2.1/src/libFLAC/ia32/fixed_asm.nasm.asm flac-1.2.1/src/libFLAC/ia32/fixed_asm.nasm ---- flac-1.2.1/src/libFLAC/ia32/fixed_asm.nasm.asm 2007-03-22 05:13:05.000000000 +0100 -+++ flac-1.2.1/src/libFLAC/ia32/fixed_asm.nasm 2008-01-29 10:33:52.000000000 +0100 -@@ -308,5 +308,5 @@ cident FLAC__fixed_compute_best_predicto - end - - %ifdef OBJ_FORMAT_elf -- section .note.GNU-stack noalloc -+ section .note.GNU-stack progbits noalloc noexec nowrite align=1 - %endif -diff -up flac-1.2.1/src/libFLAC/ia32/cpu_asm.nasm.asm flac-1.2.1/src/libFLAC/ia32/cpu_asm.nasm ---- flac-1.2.1/src/libFLAC/ia32/cpu_asm.nasm.asm 2007-03-22 05:13:05.000000000 +0100 -+++ flac-1.2.1/src/libFLAC/ia32/cpu_asm.nasm 2008-01-29 10:33:24.000000000 +0100 -@@ -117,5 +117,5 @@ cident FLAC__cpu_info_extended_amd_asm_i - end - - %ifdef OBJ_FORMAT_elf -- section .note.GNU-stack noalloc -+ section .note.GNU-stack progbits noalloc noexec nowrite align=1 - %endif -diff -up flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm.asm flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm ---- flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm.asm 2007-06-19 22:01:27.000000000 +0200 -+++ flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm 2008-01-29 10:34:40.000000000 +0100 -@@ -155,5 +155,5 @@ cident precompute_partition_info_sums_32 - end - - %ifdef OBJ_FORMAT_elf -- section .note.GNU-stack noalloc -+ section .note.GNU-stack progbits noalloc noexec nowrite align=1 - %endif diff --git a/flac-1.2.1-bitreader.patch b/flac-1.2.1-bitreader.patch deleted file mode 100644 index 24590b6..0000000 --- a/flac-1.2.1-bitreader.patch +++ /dev/null @@ -1,558 +0,0 @@ -Index: src/libFLAC/bitreader.c -=================================================================== -RCS file: /cvsroot/flac/flac/src/libFLAC/bitreader.c,v -retrieving revision 1.15 -diff -u -r1.15 bitreader.c ---- src/libFLAC/bitreader.c 28 Feb 2008 05:34:26 -0000 1.15 -+++ src/libFLAC/bitreader.c 14 Mar 2008 11:07:07 -0000 -@@ -69,13 +69,12 @@ - #endif - /* counts the # of zero MSBs in a word */ - #define COUNT_ZERO_MSBS(word) ( \ -- (word) <= 0xffff ? \ -- ( (word) <= 0xff? byte_to_unary_table[word] + 24 : byte_to_unary_table[(word) >> 8] + 16 ) : \ -- ( (word) <= 0xffffff? byte_to_unary_table[word >> 16] + 8 : byte_to_unary_table[(word) >> 24] ) \ -+ word > 0xffffff ? byte_to_unary_table[(word) >> 24] : \ -+ !word ? 32 : \ -+ word > 0xffff ? byte_to_unary_table[word >> 16] + 8 : \ -+ word > 0xff ? byte_to_unary_table[(word) >> 8] + 16 : \ -+ byte_to_unary_table[word] + 24 \ - ) --/* this alternate might be slightly faster on some systems/compilers: */ --#define COUNT_ZERO_MSBS2(word) ( (word) <= 0xff ? byte_to_unary_table[word] + 24 : ((word) <= 0xffff ? byte_to_unary_table[(word) >> 8] + 16 : ((word) <= 0xffffff ? byte_to_unary_table[(word) >> 16] + 8 : byte_to_unary_table[(word) >> 24])) ) -- - - /* - * This should be at least twice as large as the largest number of words -Index: src/libFLAC/bitreader.c -=================================================================== -RCS file: /cvsroot/flac/flac/src/libFLAC/bitreader.c,v -retrieving revision 1.15 -diff -u -r1.15 bitreader.c ---- src/libFLAC/bitreader.c 28 Feb 2008 05:34:26 -0000 1.15 -+++ src/libFLAC/bitreader.c 14 Mar 2008 13:19:46 -0000 -@@ -149,6 +148,7 @@ - FLAC__CPUInfo cpu_info; - }; - -+#if FLAC__BYTES_PER_WORD == 4 && FLAC__CPU_IA32 - #ifdef _MSC_VER - /* OPT: an MSVC built-in would be better */ - static _inline FLAC__uint32 local_swap32_(FLAC__uint32 x) -@@ -173,6 +173,15 @@ - done1: - } - } -+#elif __GNUC__ -+static void local_swap32_block_(FLAC__uint32 *start, FLAC__uint32 len) -+{ -+ FLAC__uint32 *end; -+ -+ for(end = start + len; start < end; start++) -+ asm ("bswap %0" : "=r"(*start) : "0"(*start)); -+} -+#endif - #endif - - static FLaC__INLINE void crc16_update_word_(FLAC__BitReader *br, brword word) -@@ -263,7 +272,7 @@ - #if WORDS_BIGENDIAN - #else - end = (br->words*FLAC__BYTES_PER_WORD + br->bytes + bytes + (FLAC__BYTES_PER_WORD-1)) / FLAC__BYTES_PER_WORD; --# if defined(_MSC_VER) && (FLAC__BYTES_PER_WORD == 4) -+# if FLAC__CPU_IA32 && (__GNUC__ || defined(_MSC_VER)) && FLAC__BYTES_PER_WORD == 4 - if(br->cpu_info.type == FLAC__CPUINFO_TYPE_IA32 && br->cpu_info.data.ia32.bswap) { - start = br->words; - local_swap32_block_(br->buffer + start, end - start); -Index: src/libFLAC/bitreader.c -=================================================================== -RCS file: /cvsroot/flac/flac/src/libFLAC/bitreader.c,v -retrieving revision 1.15 -diff -u -r1.15 bitreader.c ---- src/libFLAC/bitreader.c 28 Feb 2008 05:34:26 -0000 1.15 -+++ src/libFLAC/bitreader.c 17 Mar 2008 15:42:57 -0000 -@@ -803,379 +812,144 @@ - } - - /* this is by far the most heavily used reader call. it ain't pretty but it's fast */ --/* a lot of the logic is copied, then adapted, from FLAC__bitreader_read_unary_unsigned() and FLAC__bitreader_read_raw_uint32() */ - FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter) --/* OPT: possibly faster version for use with MSVC */ --#ifdef _MSC_VER - { -- unsigned i; -- unsigned uval = 0; -- unsigned bits; /* the # of binary LSBs left to read to finish a rice codeword */ -- - /* try and get br->consumed_words and br->consumed_bits into register; - * must remember to flush them back to *br before calling other -- * bitwriter functions that use them, and before returning */ -- register unsigned cwords; -- register unsigned cbits; -+ * bitreader functions that use them, and before returning */ -+ unsigned cwords, words, lsbs, msbs, x, y; -+ unsigned ucbits; /* keep track of the number of unconsumed bits in word */ -+ brword b; -+ int *val, *end; - - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - /* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */ - FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32); - FLAC__ASSERT(parameter < 32); -- /* the above two asserts also guarantee that the binary part never straddles more that 2 words, so we don't have to loop to read it */ -- -- if(nvals == 0) -- return true; -- -- cbits = br->consumed_bits; -- cwords = br->consumed_words; -+ /* the above two asserts also guarantee that the binary part never straddles more than 2 words, so we don't have to loop to read it */ - -- while(1) { -+ val = vals; -+ end = vals + nvals; - -- /* read unary part */ -- while(1) { -- while(cwords < br->words) { /* if we've not consumed up to a partial tail word... */ -- brword b = br->buffer[cwords] << cbits; -- if(b) { --#if 0 /* slower, probably due to bad register allocation... */ && defined FLAC__CPU_IA32 && !defined FLAC__NO_ASM && FLAC__BITS_PER_WORD == 32 -- __asm { -- bsr eax, b -- not eax -- and eax, 31 -- mov i, eax -- } --#else -- i = COUNT_ZERO_MSBS(b); --#endif -- uval += i; -- bits = parameter; -- i++; -- cbits += i; -- if(cbits == FLAC__BITS_PER_WORD) { -- crc16_update_word_(br, br->buffer[cwords]); -- cwords++; -- cbits = 0; -- } -- goto break1; -- } -- else { -- uval += FLAC__BITS_PER_WORD - cbits; -- crc16_update_word_(br, br->buffer[cwords]); -- cwords++; -- cbits = 0; -- /* didn't find stop bit yet, have to keep going... */ -- } -- } -- /* at this point we've eaten up all the whole words; have to try -- * reading through any tail bytes before calling the read callback. -- * this is a repeat of the above logic adjusted for the fact we -- * don't have a whole word. note though if the client is feeding -- * us data a byte at a time (unlikely), br->consumed_bits may not -- * be zero. -- */ -- if(br->bytes) { -- const unsigned end = br->bytes * 8; -- brword b = (br->buffer[cwords] & (FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << cbits; -- if(b) { -- i = COUNT_ZERO_MSBS(b); -- uval += i; -- bits = parameter; -- i++; -- cbits += i; -- FLAC__ASSERT(cbits < FLAC__BITS_PER_WORD); -- goto break1; -- } -- else { -- uval += end - cbits; -- cbits += end; -- FLAC__ASSERT(cbits < FLAC__BITS_PER_WORD); -- /* didn't find stop bit yet, have to keep going... */ -- } -- } -- /* flush registers and read; bitreader_read_from_client_() does -- * not touch br->consumed_bits at all but we still need to set -- * it in case it fails and we have to return false. -- */ -- br->consumed_bits = cbits; -- br->consumed_words = cwords; -- if(!bitreader_read_from_client_(br)) -+ if(parameter == 0) { -+ while(val < end) { -+ /* read the unary MSBs and end bit */ -+ if(!FLAC__bitreader_read_unary_unsigned(br, &msbs)) - return false; -- cwords = br->consumed_words; -- } --break1: -- /* read binary part */ -- FLAC__ASSERT(cwords <= br->words); -- -- if(bits) { -- while((br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits < bits) { -- /* flush registers and read; bitreader_read_from_client_() does -- * not touch br->consumed_bits at all but we still need to set -- * it in case it fails and we have to return false. -- */ -- br->consumed_bits = cbits; -- br->consumed_words = cwords; -- if(!bitreader_read_from_client_(br)) -- return false; -- cwords = br->consumed_words; -- } -- if(cwords < br->words) { /* if we've not consumed up to a partial tail word... */ -- if(cbits) { -- /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ -- const unsigned n = FLAC__BITS_PER_WORD - cbits; -- const brword word = br->buffer[cwords]; -- if(bits < n) { -- uval <<= bits; -- uval |= (word & (FLAC__WORD_ALL_ONES >> cbits)) >> (n-bits); -- cbits += bits; -- goto break2; -- } -- uval <<= n; -- uval |= word & (FLAC__WORD_ALL_ONES >> cbits); -- bits -= n; -- crc16_update_word_(br, word); -- cwords++; -- cbits = 0; -- if(bits) { /* if there are still bits left to read, there have to be less than 32 so they will all be in the next word */ -- uval <<= bits; -- uval |= (br->buffer[cwords] >> (FLAC__BITS_PER_WORD-bits)); -- cbits = bits; -- } -- goto break2; -- } -- else { -- FLAC__ASSERT(bits < FLAC__BITS_PER_WORD); -- uval <<= bits; -- uval |= br->buffer[cwords] >> (FLAC__BITS_PER_WORD-bits); -- cbits = bits; -- goto break2; -- } -- } -- else { -- /* in this case we're starting our read at a partial tail word; -- * the reader has guaranteed that we have at least 'bits' bits -- * available to read, which makes this case simpler. -- */ -- uval <<= bits; -- if(cbits) { -- /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ -- FLAC__ASSERT(cbits + bits <= br->bytes*8); -- uval |= (br->buffer[cwords] & (FLAC__WORD_ALL_ONES >> cbits)) >> (FLAC__BITS_PER_WORD-cbits-bits); -- cbits += bits; -- goto break2; -- } -- else { -- uval |= br->buffer[cwords] >> (FLAC__BITS_PER_WORD-bits); -- cbits += bits; -- goto break2; -- } -- } -- } --break2: -- /* compose the value */ -- *vals = (int)(uval >> 1 ^ -(int)(uval & 1)); - -- /* are we done? */ -- --nvals; -- if(nvals == 0) { -- br->consumed_bits = cbits; -- br->consumed_words = cwords; -- return true; -+ *val++ = (int)(msbs >> 1) ^ -(int)(msbs & 1); - } - -- uval = 0; -- ++vals; -- -+ return true; - } --} --#else --{ -- unsigned i; -- unsigned uval = 0; - -- /* try and get br->consumed_words and br->consumed_bits into register; -- * must remember to flush them back to *br before calling other -- * bitwriter functions that use them, and before returning */ -- register unsigned cwords; -- register unsigned cbits; -- unsigned ucbits; /* keep track of the number of unconsumed bits in the buffer */ -+ FLAC__ASSERT(parameter > 0); - -- FLAC__ASSERT(0 != br); -- FLAC__ASSERT(0 != br->buffer); -- /* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */ -- FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32); -- FLAC__ASSERT(parameter < 32); -- /* the above two asserts also guarantee that the binary part never straddles more than 2 words, so we don't have to loop to read it */ -+ cwords = br->consumed_words; -+ words = br->words; - -- if(nvals == 0) -- return true; -+ /* if we've not consumed up to a partial tail word... */ -+ if(cwords >= words) { -+ x = 0; -+ goto process_tail; -+ } -+ -+ ucbits = FLAC__BITS_PER_WORD - br->consumed_bits; -+ b = br->buffer[cwords] << br->consumed_bits; /* keep unconsumed bits aligned to left */ -+ -+ while(val < end) { -+ /* read the unary MSBs and end bit */ -+ x = y = COUNT_ZERO_MSBS(b); -+ if(x == FLAC__BITS_PER_WORD) { -+ x = ucbits; -+ do { -+ /* didn't find stop bit yet, have to keep going... */ -+ crc16_update_word_(br, br->buffer[cwords++]); -+ if (cwords >= words) -+ goto incomplete_msbs; -+ b = br->buffer[cwords]; -+ y = COUNT_ZERO_MSBS(b); -+ x += y; -+ } while(y == FLAC__BITS_PER_WORD); -+ } -+ b <<= y; -+ b <<= 1; /* account for stop bit */ -+ ucbits = (ucbits - x - 1) % FLAC__BITS_PER_WORD; -+ msbs = x; -+ -+ /* read the binary LSBs */ -+ x = b >> (FLAC__BITS_PER_WORD - parameter); -+ if(parameter <= ucbits) { -+ ucbits -= parameter; -+ b <<= parameter; -+ } else { -+ /* there are still bits left to read, they will all be in the next word */ -+ crc16_update_word_(br, br->buffer[cwords++]); -+ if (cwords >= words) -+ goto incomplete_lsbs; -+ b = br->buffer[cwords]; -+ ucbits += FLAC__BITS_PER_WORD - parameter; -+ x |= b >> ucbits; -+ b <<= FLAC__BITS_PER_WORD - ucbits; -+ } -+ lsbs = x; - -- cbits = br->consumed_bits; -- cwords = br->consumed_words; -- ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits; -+ /* compose the value */ -+ x = (msbs << parameter) | lsbs; -+ *val++ = (int)(x >> 1) ^ -(int)(x & 1); - -- while(1) { -+ continue; - -- /* read unary part */ -- while(1) { -- while(cwords < br->words) { /* if we've not consumed up to a partial tail word... */ -- brword b = br->buffer[cwords] << cbits; -- if(b) { --#if 0 /* is not discernably faster... */ && defined FLAC__CPU_IA32 && !defined FLAC__NO_ASM && FLAC__BITS_PER_WORD == 32 && defined __GNUC__ -- asm volatile ( -- "bsrl %1, %0;" -- "notl %0;" -- "andl $31, %0;" -- : "=r"(i) -- : "r"(b) -- ); --#else -- i = COUNT_ZERO_MSBS(b); --#endif -- uval += i; -- cbits += i; -- cbits++; /* skip over stop bit */ -- if(cbits >= FLAC__BITS_PER_WORD) { /* faster way of testing if(cbits == FLAC__BITS_PER_WORD) */ -- crc16_update_word_(br, br->buffer[cwords]); -- cwords++; -- cbits = 0; -- } -- goto break1; -- } -- else { -- uval += FLAC__BITS_PER_WORD - cbits; -- crc16_update_word_(br, br->buffer[cwords]); -- cwords++; -- cbits = 0; -- /* didn't find stop bit yet, have to keep going... */ -- } -- } -- /* at this point we've eaten up all the whole words; have to try -- * reading through any tail bytes before calling the read callback. -- * this is a repeat of the above logic adjusted for the fact we -- * don't have a whole word. note though if the client is feeding -- * us data a byte at a time (unlikely), br->consumed_bits may not -- * be zero. -- */ -- if(br->bytes) { -- const unsigned end = br->bytes * 8; -- brword b = (br->buffer[cwords] & ~(FLAC__WORD_ALL_ONES >> end)) << cbits; -- if(b) { -- i = COUNT_ZERO_MSBS(b); -- uval += i; -- cbits += i; -- cbits++; /* skip over stop bit */ -- FLAC__ASSERT(cbits < FLAC__BITS_PER_WORD); -- goto break1; -- } -- else { -- uval += end - cbits; -- cbits += end; -- FLAC__ASSERT(cbits < FLAC__BITS_PER_WORD); -- /* didn't find stop bit yet, have to keep going... */ -- } -+ /* at this point we've eaten up all the whole words */ -+process_tail: -+ do { -+ if(0) { -+incomplete_msbs: -+ br->consumed_bits = 0; -+ br->consumed_words = cwords; - } -- /* flush registers and read; bitreader_read_from_client_() does -- * not touch br->consumed_bits at all but we still need to set -- * it in case it fails and we have to return false. -- */ -- br->consumed_bits = cbits; -- br->consumed_words = cwords; -- if(!bitreader_read_from_client_(br)) -+ -+ /* read the unary MSBs and end bit */ -+ if(!FLAC__bitreader_read_unary_unsigned(br, &msbs)) - return false; -- cwords = br->consumed_words; -- ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits + uval; -- /* + uval to offset our count by the # of unary bits already -- * consumed before the read, because we will add these back -- * in all at once at break1 -- */ -- } --break1: -- ucbits -= uval; -- ucbits--; /* account for stop bit */ -- -- /* read binary part */ -- FLAC__ASSERT(cwords <= br->words); -- -- if(parameter) { -- while(ucbits < parameter) { -- /* flush registers and read; bitreader_read_from_client_() does -- * not touch br->consumed_bits at all but we still need to set -- * it in case it fails and we have to return false. -- */ -- br->consumed_bits = cbits; -+ msbs += x; -+ x = ucbits = 0; -+ -+ if(0) { -+incomplete_lsbs: -+ br->consumed_bits = 0; - br->consumed_words = cwords; -- if(!bitreader_read_from_client_(br)) -- return false; -- cwords = br->consumed_words; -- ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits; -- } -- if(cwords < br->words) { /* if we've not consumed up to a partial tail word... */ -- if(cbits) { -- /* this also works when consumed_bits==0, it's just slower than necessary for that case */ -- const unsigned n = FLAC__BITS_PER_WORD - cbits; -- const brword word = br->buffer[cwords]; -- if(parameter < n) { -- uval <<= parameter; -- uval |= (word & (FLAC__WORD_ALL_ONES >> cbits)) >> (n-parameter); -- cbits += parameter; -- } -- else { -- uval <<= n; -- uval |= word & (FLAC__WORD_ALL_ONES >> cbits); -- crc16_update_word_(br, word); -- cwords++; -- cbits = parameter - n; -- if(cbits) { /* parameter > n, i.e. if there are still bits left to read, there have to be less than 32 so they will all be in the next word */ -- uval <<= cbits; -- uval |= (br->buffer[cwords] >> (FLAC__BITS_PER_WORD-cbits)); -- } -- } -- } -- else { -- cbits = parameter; -- uval <<= parameter; -- uval |= br->buffer[cwords] >> (FLAC__BITS_PER_WORD-cbits); -- } - } -- else { -- /* in this case we're starting our read at a partial tail word; -- * the reader has guaranteed that we have at least 'parameter' -- * bits available to read, which makes this case simpler. -- */ -- uval <<= parameter; -- if(cbits) { -- /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ -- FLAC__ASSERT(cbits + parameter <= br->bytes*8); -- uval |= (br->buffer[cwords] & (FLAC__WORD_ALL_ONES >> cbits)) >> (FLAC__BITS_PER_WORD-cbits-parameter); -- cbits += parameter; -- } -- else { -- cbits = parameter; -- uval |= br->buffer[cwords] >> (FLAC__BITS_PER_WORD-cbits); -- } -- } -- } - -- ucbits -= parameter; -- -- /* compose the value */ -- *vals = (int)(uval >> 1 ^ -(int)(uval & 1)); -+ /* read the binary LSBs */ -+ if(!FLAC__bitreader_read_raw_uint32(br, &lsbs, parameter - ucbits)) -+ return false; -+ lsbs = x | lsbs; - -- /* are we done? */ -- --nvals; -- if(nvals == 0) { -- br->consumed_bits = cbits; -- br->consumed_words = cwords; -- return true; -- } -+ /* compose the value */ -+ x = (msbs << parameter) | lsbs; -+ *val++ = (int)(x >> 1) ^ -(int)(x & 1); -+ x = 0; - -- uval = 0; -- ++vals; -+ cwords = br->consumed_words; -+ words = br->words; -+ ucbits = FLAC__BITS_PER_WORD - br->consumed_bits; -+ b = br->buffer[cwords] << br->consumed_bits; -+ } while(cwords >= words && val < end); -+ } - -+ if(ucbits == 0 && cwords < words) { -+ /* don't leave the head word with no unconsumed bits */ -+ crc16_update_word_(br, br->buffer[cwords++]); -+ ucbits = FLAC__BITS_PER_WORD; - } -+ -+ br->consumed_bits = FLAC__BITS_PER_WORD - ucbits; -+ br->consumed_words = cwords; -+ -+ return true; - } --#endif - - #if 0 /* UNUSED */ - FLAC__bool FLAC__bitreader_read_golomb_signed(FLAC__BitReader *br, int *val, unsigned parameter) diff --git a/flac-1.2.1.tar.bz2 b/flac-1.2.1.tar.bz2 deleted file mode 100644 index f2aed65..0000000 --- a/flac-1.2.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:283e40f475c40581f38eb2847309e957e6f3ba4f5ab5e1662bb2adc5439dcb84 -size 1459474 diff --git a/flac-1.2.1_git201212051942.tar.xz b/flac-1.2.1_git201212051942.tar.xz new file mode 100644 index 0000000..7d2d542 --- /dev/null +++ b/flac-1.2.1_git201212051942.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e769aa7369c09137e55c63f2ec15addcaf6495f9bfe09dfbc086fd5c4b8ecc84 +size 835460 diff --git a/flac-gcc43-fixes.diff b/flac-gcc43-fixes.diff deleted file mode 100644 index 665cc18..0000000 --- a/flac-gcc43-fixes.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- examples/cpp/encode/file/main.cpp-dist 2007-10-22 15:14:12.000000000 +0200 -+++ examples/cpp/encode/file/main.cpp 2007-10-22 15:14:41.000000000 +0200 -@@ -30,6 +30,7 @@ - - #include - #include -+#include - #include "FLAC++/metadata.h" - #include "FLAC++/encoder.h" - diff --git a/flac-gcc47.patch b/flac-gcc47.patch deleted file mode 100644 index 5d9c7dc..0000000 --- a/flac-gcc47.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: flac-1.2.1/src/metaflac/options.c -=================================================================== ---- flac-1.2.1.orig/src/metaflac/options.c -+++ flac-1.2.1/src/metaflac/options.c -@@ -1041,7 +1041,7 @@ FLAC__bool parse_block_type(const char * - out->entries[entry].filter_application_by_id = (0 != r); - if(0 != r) { - if(strlen(r) == 4) { -- strcpy(out->entries[entry].application_id, r); -+ memcpy(out->entries[entry].application_id, r, 4); - } - else if(strlen(r) == 10 && strncmp(r, "0x", 2) == 0 && strspn(r+2, "0123456789ABCDEFabcdef") == 8) { - FLAC__uint32 x = strtoul(r+2, 0, 16); diff --git a/flac-leaks.patch b/flac-leaks.patch deleted file mode 100644 index 4ac0136..0000000 --- a/flac-leaks.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- src/libFLAC/metadata_iterators.c.orig -+++ src/libFLAC/metadata_iterators.c -@@ -1217,6 +1217,7 @@ static FLAC__bool chain_read_cb_(FLAC__M - } - - if(!read_metadata_block_header_cb_(handle, read_cb, &is_last, &type, &length)) { -+ node_delete_(node); - chain->status = FLAC__METADATA_CHAIN_STATUS_READ_ERROR; - return false; - } -@@ -1412,11 +1413,13 @@ static FLAC__bool chain_rewrite_file_(FL - if(!open_tempfile_(chain->filename, tempfile_path_prefix, &tempfile, &tempfilename, &status)) { - chain->status = get_equivalent_status_(status); - cleanup_tempfile_(&tempfile, &tempfilename); -+ fclose(f); - return false; - } - if(!copy_n_bytes_from_file_(f, tempfile, chain->first_offset, &status)) { - chain->status = get_equivalent_status_(status); - cleanup_tempfile_(&tempfile, &tempfilename); -+ fclose(f); - return false; - } - -@@ -1424,10 +1427,14 @@ static FLAC__bool chain_rewrite_file_(FL - for(node = chain->head; node; node = node->next) { - if(!write_metadata_block_header_(tempfile, &status, node->data)) { - chain->status = get_equivalent_status_(status); -+ cleanup_tempfile_(&tempfile, &tempfilename); -+ fclose(f); - return false; - } - if(!write_metadata_block_data_(tempfile, &status, node->data)) { - chain->status = get_equivalent_status_(status); -+ cleanup_tempfile_(&tempfile, &tempfilename); -+ fclose(f); - return false; - } - } -@@ -1437,10 +1444,12 @@ static FLAC__bool chain_rewrite_file_(FL - if(0 != fseeko(f, chain->last_offset, SEEK_SET)) { - cleanup_tempfile_(&tempfile, &tempfilename); - chain->status = FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR; -+ fclose(f); - return false; - } - if(!copy_remaining_bytes_from_file_(f, tempfile, &status)) { - cleanup_tempfile_(&tempfile, &tempfilename); -+ fclose(f); - chain->status = get_equivalent_status_(status); - return false; - } ---- src/libFLAC/stream_encoder.c.orig -+++ src/libFLAC/stream_encoder.c -@@ -1004,10 +1004,12 @@ static FLAC__StreamEncoderInitStatus ini - /* - * Now set up a stream decoder for verification - */ -- encoder->private_->verify.decoder = FLAC__stream_decoder_new(); - if(0 == encoder->private_->verify.decoder) { -- encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR; -- return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; -+ encoder->private_->verify.decoder = FLAC__stream_decoder_new(); -+ if(0 == encoder->private_->verify.decoder) { -+ encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR; -+ return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; -+ } - } - - if(FLAC__stream_decoder_init_stream(encoder->private_->verify.decoder, verify_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, verify_write_callback_, verify_metadata_callback_, verify_error_callback_, /*client_data=*/encoder) != FLAC__STREAM_DECODER_INIT_STATUS_OK) { diff --git a/flac-no-xmms.diff b/flac-no-xmms.diff deleted file mode 100644 index 2037ee1..0000000 --- a/flac-no-xmms.diff +++ /dev/null @@ -1,17 +0,0 @@ -Index: configure.in -=================================================================== ---- configure.in.orig -+++ configure.in -@@ -225,9 +225,9 @@ AC_HELP_STRING([--disable-xmms-plugin], - no) enable_xmms_plugin=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;; - esac],[enable_xmms_plugin=true]) --if test "x$enable_xmms_plugin" != xfalse ; then -- AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built])) --fi -+dnl if test "x$enable_xmms_plugin" != xfalse ; then -+dnl AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built])) -+dnl fi - AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR") - - dnl build FLAC++ or not diff --git a/flac-openssl.patch b/flac-openssl.patch new file mode 100644 index 0000000..426d5be --- /dev/null +++ b/flac-openssl.patch @@ -0,0 +1,424 @@ + +Return-Path: +Received: from localhost.localdomain ([190.162.79.17]) + by mx.google.com with ESMTPS id u20sm58699689yhi.10.2012.05.05.14.35.00 + (version=TLSv1/SSLv3 cipher=OTHER); + Sat, 05 May 2012 14:35:02 -0700 (PDT) +Sender: =?UTF-8?Q?Cristian_Rodr=C3=ADguez?= +From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= +To: flac-dev@xiph.org +Cc: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= +Subject: =?UTF-8?q?=5BPATCH=5D=20Optionally=2C=20allow=20distros=20to=20use=20openssl=20for=20MD5=20verification?= +Date: Sat, 5 May 2012 17:34:31 -0400 +Message-Id: <1336253671-7262-1-git-send-email-crrodriguez@opensuse.org> +X-Mailer: git-send-email 1.7.7 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This has the advantage of being more efficient than the included +routines and allows distros to centralize crypto mainteniance on +a few libraries. +--- + configure.ac | 4 +- + m4/ax_check_openssl.m4 | 124 +++++++++++++++++++++++++++++++++++++ + src/libFLAC/Makefile.am | 2 +- + src/libFLAC/include/private/md5.h | 8 ++- + src/libFLAC/md5.c | 38 +++++++++++ + src/libFLAC/stream_decoder.c | 30 +++++++-- + src/libFLAC/stream_encoder.c | 30 +++++++-- + 7 files changed, 220 insertions(+), 16 deletions(-) + create mode 100644 m4/ax_check_openssl.m4 + +--- flac-1.2.1_git201212051942.orig/configure.ac ++++ flac-1.2.1_git201212051942/configure.ac +@@ -58,7 +58,7 @@ AM_PROG_CC_C_O + AC_C_INLINE + AC_C_VARARRAYS + AC_C_TYPEOF +- ++AC_FUNC_ALLOCA + AC_CHECK_HEADERS(stdint.h) + AC_SUBST(HAVE_STDINT_H) + AC_CHECK_HEADERS(inttypes.h) +@@ -85,6 +85,8 @@ dnl check for getopt in standard library + dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) + AC_CHECK_FUNCS(getopt_long, [], []) + ++AX_CHECK_OPENSSL([AC_DEFINE([HAVE_OPENSSL], [1], [We have openSSL])]) ++ + case "$host_cpu" in + i*86) + cpu_ia32=true +--- /dev/null ++++ flac-1.2.1_git201212051942/m4/ax_check_openssl.m4 +@@ -0,0 +1,124 @@ ++# =========================================================================== ++# http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) ++# ++# DESCRIPTION ++# ++# Look for OpenSSL in a number of default spots, or in a user-selected ++# spot (via --with-openssl). Sets ++# ++# OPENSSL_INCLUDES to the include directives required ++# OPENSSL_LIBS to the -l directives required ++# OPENSSL_LDFLAGS to the -L or -R flags required ++# ++# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately ++# ++# This macro sets OPENSSL_INCLUDES such that source files should use the ++# openssl/ directory in include directives: ++# ++# #include ++# ++# LICENSE ++# ++# Copyright (c) 2009,2010 Zmanda Inc. ++# Copyright (c) 2009,2010 Dustin J. Mitchell ++# ++# Copying and distribution of this file, with or without modification, are ++# permitted in any medium without royalty provided the copyright notice ++# and this notice are preserved. This file is offered as-is, without any ++# warranty. ++ ++#serial 8 ++ ++AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) ++AC_DEFUN([AX_CHECK_OPENSSL], [ ++ found=false ++ AC_ARG_WITH([openssl], ++ [AS_HELP_STRING([--with-openssl=DIR], ++ [root of the OpenSSL directory])], ++ [ ++ case "$withval" in ++ "" | y | ye | yes | n | no) ++ AC_MSG_ERROR([Invalid --with-openssl value]) ++ ;; ++ *) ssldirs="$withval" ++ ;; ++ esac ++ ], [ ++ # if pkg-config is installed and openssl has installed a .pc file, ++ # then use that information and don't search ssldirs ++ AC_PATH_PROG([PKG_CONFIG], [pkg-config]) ++ if test x"$PKG_CONFIG" != x""; then ++ OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` ++ if test $? = 0; then ++ OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` ++ OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` ++ found=true ++ fi ++ fi ++ ++ # no such luck; use some default ssldirs ++ if ! $found; then ++ ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" ++ fi ++ ] ++ ) ++ ++ ++ # note that we #include , so the OpenSSL headers have to be in ++ # an 'openssl' subdirectory ++ ++ if ! $found; then ++ OPENSSL_INCLUDES= ++ for ssldir in $ssldirs; do ++ AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) ++ if test -f "$ssldir/include/openssl/ssl.h"; then ++ OPENSSL_INCLUDES="-I$ssldir/include" ++ OPENSSL_LDFLAGS="-L$ssldir/lib" ++ OPENSSL_LIBS="-lssl -lcrypto" ++ found=true ++ AC_MSG_RESULT([yes]) ++ break ++ else ++ AC_MSG_RESULT([no]) ++ fi ++ done ++ ++ # if the file wasn't found, well, go ahead and try the link anyway -- maybe ++ # it will just work! ++ fi ++ ++ # try the preprocessor and linker with our new flags, ++ # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS ++ ++ AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) ++ echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ ++ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD ++ ++ save_LIBS="$LIBS" ++ save_LDFLAGS="$LDFLAGS" ++ save_CPPFLAGS="$CPPFLAGS" ++ LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" ++ LIBS="$OPENSSL_LIBS $LIBS" ++ CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" ++ AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM([#include ], [SSL_new(NULL)])], ++ [ ++ AC_MSG_RESULT([yes]) ++ $1 ++ ], [ ++ AC_MSG_RESULT([no]) ++ $2 ++ ]) ++ CPPFLAGS="$save_CPPFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++ LIBS="$save_LIBS" ++ ++ AC_SUBST([OPENSSL_INCLUDES]) ++ AC_SUBST([OPENSSL_LIBS]) ++ AC_SUBST([OPENSSL_LDFLAGS]) ++]) +--- flac-1.2.1_git201212051942.orig/src/libFLAC/Makefile.am ++++ flac-1.2.1_git201212051942/src/libFLAC/Makefile.am +@@ -79,7 +79,7 @@ endif + endif + endif + +-libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ -lm ++libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OPENSSL_LIBS@ @OGG_LIBS@ -lm + + SUBDIRS = $(ARCH_SUBDIRS) include . + +@@ -131,5 +131,5 @@ libFLAC_sources = \ + libFLAC_la_SOURCES = $(libFLAC_sources) + + # needed for test_libFLAC +-libFLAC_static_la_LIBADD = $(LOCAL_EXTRA_LIBADD) ++libFLAC_static_la_LIBADD = $(LOCAL_EXTRA_LIBADD) $(OPENSSL_LIBS) + libFLAC_static_la_SOURCES = $(libFLAC_sources) +--- flac-1.2.1_git201212051942.orig/src/libFLAC/include/private/md5.h ++++ flac-1.2.1_git201212051942/src/libFLAC/include/private/md5.h +@@ -28,6 +28,11 @@ + + #include "FLAC/ordinals.h" + ++#if defined(HAVE_OPENSSL) ++#include ++#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); + +--- flac-1.2.1_git201212051942.orig/src/libFLAC/md5.c ++++ flac-1.2.1_git201212051942/src/libFLAC/md5.c +@@ -5,6 +5,19 @@ + #include /* for malloc() */ + #include /* for memcpy() */ + ++#ifdef HAVE_ALLOCA_H ++# include ++#elif !defined alloca ++# ifdef __GNUC__ ++# define alloca __builtin_alloca ++# elif defined _AIX ++# define alloca __alloca ++# elif defined _MSC_VER ++# include ++# define alloca _alloca ++# endif ++#endif ++ + #include "private/md5.h" + #include "share/alloc.h" + +@@ -35,6 +48,7 @@ + + /* The four core functions - F1 is optimized somewhat */ + ++#if !defined(HAVE_OPENSSL) + /* #define F1(x, y, z) (x & y | ~x & z) */ + #define F1(x, y, z) (z ^ (x & (y ^ z))) + #define F2(x, y, z) F1(z, x, y) +@@ -267,6 +281,8 @@ void FLAC__MD5Final(FLAC__byte digest[16 + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ + } + ++#endif /* !defined(HAVE_OPENSSL) */ ++ + /* + * Convert the incoming audio signal to a byte stream + */ +@@ -401,6 +417,26 @@ FLAC__bool FLAC__MD5Accumulate(FLAC__MD5 + if((size_t)channels * (size_t)bytes_per_sample > SIZE_MAX / (size_t)samples) + return false; + ++#if defined(HAVE_OPENSSL) ++ /* Use stack for the most common cases, heap when bytes_needed is larger than 4032 (unlikely) ++ * Note that this is a _very_ conservative estimation. ++ */ ++#if defined(_MSC_VER) ++/* see http://msdn.microsoft.com/en-us/library/5471dc8s(v=vs.80).aspx for the rationale */ ++ FLAC__byte *tmp = _malloca(bytes_needed); ++#else ++ const FLAC__bool usealloca = (bytes_needed < 4032); ++ FLAC__byte *tmp = usealloca ? alloca(bytes_needed) : safe_malloc_(bytes_needed); ++#endif ++ format_input_(tmp, signal, channels, samples, bytes_per_sample); ++ const FLAC__bool retval = (EVP_DigestUpdate(ctx, tmp , bytes_needed) == 1); ++#if defined(_MSC_VER) ++ _freea(tmp) ++#else ++ if(!usealloca) free(tmp); ++#endif ++ return retval; ++#else + if(ctx->capacity < bytes_needed) { + FLAC__byte *tmp = realloc(ctx->internal_buf, bytes_needed); + if(0 == tmp) { +@@ -418,4 +454,6 @@ FLAC__bool FLAC__MD5Accumulate(FLAC__MD5 + FLAC__MD5Update(ctx, ctx->internal_buf, bytes_needed); + + return true; ++#endif ++ + } +--- flac-1.2.1_git201212051942.orig/src/libFLAC/stream_decoder.c ++++ flac-1.2.1_git201212051942/src/libFLAC/stream_decoder.c +@@ -164,7 +164,7 @@ typedef struct FLAC__StreamDecoderPrivat + FLAC__bool internal_reset_hack; /* used only during init() so we can call reset to set up the decoder without rewinding the input */ + FLAC__bool is_seeking; + FLAC__MD5Context md5context; +- FLAC__byte computed_md5sum[16]; /* this is the sum we computed from the decoded data */ ++ FLAC__byte computed_md5sum[EVP_MAX_MD_SIZE]; /* this is the sum we computed from the decoded data */ + /* (the rest of these are only used for seeking) */ + FLAC__Frame last_frame; /* holds the info of the last frame we seeked to */ + FLAC__uint64 first_frame_offset; /* hint to the seek routine of where in the stream the first audio frame starts */ +@@ -301,7 +301,9 @@ FLAC_API FLAC__StreamDecoder *FLAC__stre + decoder->private_->file = 0; + + set_defaults_(decoder); +- ++#if defined(HAVE_OPENSSL) ++ EVP_MD_CTX_init(&decoder->private_->md5context); ++#endif + decoder->protected_->state = FLAC__STREAM_DECODER_UNINITIALIZED; + + return decoder; +@@ -327,7 +329,9 @@ FLAC_API void FLAC__stream_decoder_delet + + for(i = 0; i < FLAC__MAX_CHANNELS; i++) + FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(&decoder->private_->partitioned_rice_contents[i]); +- ++#if defined(HAVE_OPENSSL) ++ EVP_MD_CTX_cleanup(&decoder->private_->md5context); ++#endif + free(decoder->private_); + free(decoder->protected_); + free(decoder); +@@ -647,8 +651,16 @@ FLAC_API FLAC__bool FLAC__stream_decoder + /* see the comment in FLAC__seekable_stream_decoder_reset() as to why we + * always call FLAC__MD5Final() + */ ++#if defined(HAVE_OPENSSL) ++ /* decoder->private_->computed_md5sum is NULL when decoder->private_->do_md5_checking == false ++ * that causes assertion failure crash in openSSL. ++ */ ++ if(decoder->private_->do_md5_checking) { ++ md5_failed = (EVP_DigestFinal_ex(&decoder->private_->md5context, decoder->private_->computed_md5sum, NULL) == 0); ++ } ++#else + FLAC__MD5Final(decoder->private_->computed_md5sum, &decoder->private_->md5context); +- ++#endif + if(decoder->private_->has_seek_table && 0 != decoder->private_->seek_table.data.seek_table.points) { + free(decoder->private_->seek_table.data.seek_table.points); + decoder->private_->seek_table.data.seek_table.points = 0; +@@ -999,11 +1011,15 @@ FLAC_API FLAC__bool FLAC__stream_decoder + * FLAC__stream_decoder_finish() to make sure things are always cleaned up + * properly. + */ +- FLAC__MD5Init(&decoder->private_->md5context); ++ decoder->private_->first_frame_offset = 0; + +- decoder->private_->first_frame_offset = 0; +- decoder->private_->unparseable_frame_count = 0; ++ decoder->private_->unparseable_frame_count = 0; + ++#if defined(HAVE_OPENSSL) ++ return (EVP_DigestInit_ex(&decoder->private_->md5context, EVP_md5(), NULL) == 1); ++#else ++▷⋅⋅⋅FLAC__MD5Init(&decoder->private_->md5context); ++#endif + return true; + } + +--- flac-1.2.1_git201212051942.orig/src/libFLAC/stream_encoder.c ++++ flac-1.2.1_git201212051942/src/libFLAC/stream_encoder.c +@@ -562,7 +562,9 @@ FLAC_API FLAC__StreamEncoder *FLAC__stre + FLAC__format_entropy_coding_method_partitioned_rice_contents_init(&encoder->private_->partitioned_rice_contents_extra[i]); + + encoder->protected_->state = FLAC__STREAM_ENCODER_UNINITIALIZED; +- ++#if defined(HAVE_OPENSSL) ++ if(encoder->protected_->do_md5) EVP_MD_CTX_init(&encoder->private_->md5context); ++#endif + return encoder; + } + +@@ -596,6 +598,11 @@ FLAC_API void FLAC__stream_encoder_delet + FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(&encoder->private_->partitioned_rice_contents_extra[i]); + + FLAC__bitwriter_delete(encoder->private_->frame); ++#if defined(HAVE_OPENSSL) ++ if(encoder->protected_->do_md5) { ++ EVP_MD_CTX_cleanup(&encoder->private_->md5context); ++ } ++#endif + free(encoder->private_); + free(encoder->protected_); + free(encoder); +@@ -1029,8 +1036,15 @@ static FLAC__StreamEncoderInitStatus ini + encoder->private_->streaminfo.data.stream_info.bits_per_sample = encoder->protected_->bits_per_sample; + encoder->private_->streaminfo.data.stream_info.total_samples = encoder->protected_->total_samples_estimate; /* we will replace this later with the real total */ + memset(encoder->private_->streaminfo.data.stream_info.md5sum, 0, 16); /* we don't know this yet; have to fill it in later */ +- if(encoder->protected_->do_md5) +- FLAC__MD5Init(&encoder->private_->md5context); ++ if(encoder->protected_->do_md5) { ++#if defined(HAVE_OPENSSL) ++ if(EVP_DigestInit_ex(&encoder->private_->md5context, EVP_md5(), NULL) == 0) { ++ return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; ++ } ++#else ++ FLAC__MD5Init(&encoder->private_->md5context); ++#endif ++ } + if(!FLAC__add_metadata_block(&encoder->private_->streaminfo, encoder->private_->frame)) { + encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; + return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; +@@ -1299,9 +1313,13 @@ FLAC_API FLAC__bool FLAC__stream_encoder + } + } + +- if(encoder->protected_->do_md5) +- FLAC__MD5Final(encoder->private_->streaminfo.data.stream_info.md5sum, &encoder->private_->md5context); +- ++ if(encoder->protected_->do_md5) { ++#if defined(HAVE_OPENSSL) ++ error = (EVP_DigestFinal_ex(&encoder->private_->md5context, encoder->private_->streaminfo.data.stream_info.md5sum, NULL) == 0); ++#else ++ FLAC__MD5Final(encoder->private_->streaminfo.data.stream_info.md5sum, &encoder->private_->md5context); ++#endif ++ } + if(!encoder->private_->is_being_deleted) { + if(encoder->protected_->state == FLAC__STREAM_ENCODER_OK) { + if(encoder->private_->seek_callback) { diff --git a/flac-printf-format-fix.diff b/flac-printf-format-fix.diff deleted file mode 100644 index ce5875a..0000000 --- a/flac-printf-format-fix.diff +++ /dev/null @@ -1,43 +0,0 @@ ---- src/test_grabbag/cuesheet/main.c-dist 2007-04-10 19:14:42.000000000 +0200 -+++ src/test_grabbag/cuesheet/main.c 2007-04-10 19:15:33.000000000 +0200 -@@ -115,12 +115,12 @@ int main(int argc, char *argv[]) - const char *usage = "usage: test_cuesheet cuesheet_file lead_out_offset [ cdda ]\n"; - - if(argc > 1 && 0 == strcmp(argv[1], "-h")) { -- printf(usage); -+ fputs(usage, stdout); - return 0; - } - - if(argc < 3 || argc > 4) { -- fprintf(stderr, usage); -+ fputs(usage, stderr); - return 255; - } - -@@ -129,7 +129,7 @@ int main(int argc, char *argv[]) - if(0 == strcmp(argv[3], "cdda")) - is_cdda = true; - else { -- fprintf(stderr, usage); -+ fputs(usage, stderr); - return 255; - } - } ---- src/test_grabbag/picture/main.c-dist 2007-04-10 19:15:47.000000000 +0200 -+++ src/test_grabbag/picture/main.c 2007-04-10 19:16:02.000000000 +0200 -@@ -211,12 +211,12 @@ int main(int argc, char *argv[]) - const char *usage = "usage: test_pictures path_prefix\n"; - - if(argc > 1 && 0 == strcmp(argv[1], "-h")) { -- printf(usage); -+ fputs(usage, stdout); - return 0; - } - - if(argc != 2) { -- fprintf(stderr, usage); -+ fputs(usage, stderr); - return 255; - } - diff --git a/flac-visibility.patch b/flac-visibility.patch deleted file mode 100644 index a6e31f9..0000000 --- a/flac-visibility.patch +++ /dev/null @@ -1,348 +0,0 @@ -Index: include/FLAC/export.h -=================================================================== ---- include/FLAC/export.h.orig -+++ include/FLAC/export.h -@@ -56,7 +56,7 @@ - */ - - #if defined(FLAC__NO_DLL) || !defined(_MSC_VER) --#define FLAC_API -+#define FLAC_API __attribute__ ((visibility ("default"))) - - #else - -Index: include/FLAC++/export.h -=================================================================== ---- include/FLAC++/export.h.orig -+++ include/FLAC++/export.h -@@ -56,7 +56,7 @@ - */ - - #if defined(FLAC__NO_DLL) || !defined(_MSC_VER) --#define FLACPP_API -+#define FLACPP_API __attribute__ ((visibility ("default"))) - - #else - -Index: src/libFLAC/Makefile.am -=================================================================== ---- src/libFLAC/Makefile.am.orig -+++ src/libFLAC/Makefile.am -@@ -68,7 +68,7 @@ endif - endif - endif - endif -- -+libFLAC_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden - libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ - - SUBDIRS = $(ARCH_SUBDIRS) include . -@@ -96,7 +96,7 @@ extra_ogg_sources = \ - ogg_mapping.c - endif - # see 'http://www.gnu.org/software/libtool/manual.html#Libtool-versioning' for numbering convention --libFLAC_la_LDFLAGS = -version-info 10:0:2 -lm $(LOCAL_EXTRA_LDFLAGS) -+libFLAC_la_LDFLAGS = -Wl,-Bsymbolic-functions -no-undefined -version-info 10:0:2 -lm $(LOCAL_EXTRA_LDFLAGS) - libFLAC_la_SOURCES = \ - bitmath.c \ - bitreader.c \ -Index: src/libFLAC++/Makefile.am -=================================================================== ---- src/libFLAC++/Makefile.am.orig -+++ src/libFLAC++/Makefile.am -@@ -45,8 +45,9 @@ EXTRA_DIST = \ - libFLAC++_static.vcproj \ - libFLAC++.m4 - -+libFLAC___la_CXXFLAGS= -fvisibility=hidden -fvisibility-inlines-hidden - # see 'http://www.gnu.org/software/libtool/manual.html#Libtool-versioning' for numbering convention --libFLAC___la_LDFLAGS = -version-info 8:0:2 -+libFLAC___la_LDFLAGS = -Wl,-Bsymbolic-functions -no-undefined -version-info 8:0:2 - libFLAC___la_LIBADD = ../libFLAC/libFLAC.la - - libFLAC___la_SOURCES = \ -Index: configure.in -=================================================================== ---- configure.in.orig -+++ configure.in -@@ -18,7 +18,8 @@ - # NOTE that for many of the AM_CONDITIONALs we use the prefix FLaC__ - # instead of FLAC__ since autoconf triggers off 'AC_' in strings - --AC_INIT(src/flac/main.c) -+AC_INIT -+AC_CONFIG_SRCDIR([src/flac/main.c]) - AM_INIT_AUTOMAKE(flac, 1.2.1) - - # Don't automagically regenerate autoconf/automake generated files unless -@@ -28,23 +29,24 @@ AM_MAINTAINER_MODE - # We need two libtools, one that builds both shared and static, and - # one that builds only static. This is because the resulting libtool - # does not allow us to choose which to build at runtime. --AM_PROG_LIBTOOL --sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static --chmod +x libtool-disable-static -+#AM_PROG_LIBTOOL -+#sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static -+#chmod +x libtool-disable-static - - AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") - - AM_PROG_AS -+AC_PROG_CC_STDC - AC_PROG_CXX - AC_PROG_MAKE_SET -- -+AC_USE_SYSTEM_EXTENSIONS - AC_SYS_LARGEFILE - AC_FUNC_FSEEKO -- -+LT_INIT([pic-only disable-static]) - AC_CHECK_SIZEOF(void*,0) - - #@@@ new name is AC_CONFIG_HEADERS --AM_CONFIG_HEADER(config.h) -+AC_CONFIG_HEADERS([config.h]) - - AC_C_BIGENDIAN - -@@ -110,7 +112,7 @@ AC_DEFINE(FLAC__ALIGN_MALLOC_DATA) - AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries]) - fi - --AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes) -+AC_ARG_ENABLE(asm-optimizations, AS_HELP_STRING([--disable-asm-optimizations],[Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes) - AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno) - if test "x$asm_opt" = xno ; then - AC_DEFINE(FLAC__NO_ASM) -@@ -118,7 +120,7 @@ AH_TEMPLATE(FLAC__NO_ASM, [define to dis - fi - - AC_ARG_ENABLE(debug, --AC_HELP_STRING([--enable-debug], [Turn on debugging]), -+AS_HELP_STRING([--enable-debug],[Turn on debugging]), - [case "${enableval}" in - yes) debug=true ;; - no) debug=false ;; -@@ -127,7 +129,7 @@ esac],[debug=false]) - AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue) - - AC_ARG_ENABLE(sse, --AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]), -+AS_HELP_STRING([--enable-sse],[Enable SSE support by asserting that the OS supports SSE instructions]), - [case "${enableval}" in - yes) sse_os=true ;; - no) sse_os=false ;; -@@ -140,7 +142,7 @@ AH_TEMPLATE(FLAC__SSE_OS, [define if you - fi - - AC_ARG_ENABLE(3dnow, --AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]), -+AS_HELP_STRING([--disable-3dnow],[Disable 3DNOW! optimizations]), - [case "${enableval}" in - yes) use_3dnow=true ;; - no) use_3dnow=false ;; -@@ -153,7 +155,7 @@ AH_TEMPLATE(FLAC__USE_3DNOW, [define to - fi - - AC_ARG_ENABLE(altivec, --AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]), -+AS_HELP_STRING([--disable-altivec],[Disable Altivec optimizations]), - [case "${enableval}" in - yes) use_altivec=true ;; - no) use_altivec=false ;; -@@ -166,14 +168,14 @@ AH_TEMPLATE(FLAC__USE_ALTIVEC, [define t - fi - - AC_ARG_ENABLE(thorough-tests, --AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]), -+AS_HELP_STRING([--disable-thorough-tests],[Disable thorough (long) testing, do only basic tests]), - [case "${enableval}" in - yes) thorough_tests=true ;; - no) thorough_tests=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;; - esac],[thorough_tests=true]) - AC_ARG_ENABLE(exhaustive-tests, --AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]), -+AS_HELP_STRING([--enable-exhaustive-tests],[Enable exhaustive testing (VERY long)]), - [case "${enableval}" in - yes) exhaustive_tests=true ;; - no) exhaustive_tests=false ;; -@@ -189,7 +191,7 @@ fi - AC_SUBST(FLAC__TEST_LEVEL) - - AC_ARG_ENABLE(valgrind-testing, --AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]), -+AS_HELP_STRING([--enable-valgrind-testing],[Run all tests inside Valgrind]), - [case "${enableval}" in - yes) FLAC__TEST_WITH_VALGRIND=yes ;; - no) FLAC__TEST_WITH_VALGRIND=no ;; -@@ -198,7 +200,7 @@ esac],[FLAC__TEST_WITH_VALGRIND=no]) - AC_SUBST(FLAC__TEST_WITH_VALGRIND) - - AC_ARG_ENABLE(doxygen-docs, --AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]), -+AS_HELP_STRING([--disable-doxygen-docs],[Disable API documentation building via Doxygen]), - [case "${enableval}" in - yes) enable_doxygen_docs=true ;; - no) enable_doxygen_docs=false ;; -@@ -210,7 +212,7 @@ fi - AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN") - - AC_ARG_ENABLE(local-xmms-plugin, --AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]), -+AS_HELP_STRING([--enable-local-xmms-plugin],[Install XMMS plugin to ~/.xmms/Plugins instead of system location]), - [case "${enableval}" in - yes) install_xmms_plugin_locally=true ;; - no) install_xmms_plugin_locally=false ;; -@@ -219,7 +221,7 @@ esac],[install_xmms_plugin_locally=false - AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue) - - AC_ARG_ENABLE(xmms-plugin, --AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]), -+AS_HELP_STRING([--disable-xmms-plugin],[Do not build XMMS plugin]), - [case "${enableval}" in - yes) enable_xmms_plugin=true ;; - no) enable_xmms_plugin=false ;; -@@ -232,7 +234,7 @@ AM_CONDITIONAL(FLaC__HAS_XMMS, test -n " - - dnl build FLAC++ or not - AC_ARG_ENABLE([cpplibs], --AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]), -+AS_HELP_STRING([--disable-cpplibs],[Do not build libFLAC++]), - [case "${enableval}" in - yes) disable_cpplibs=false ;; - no) disable_cpplibs=true ;; -@@ -242,7 +244,7 @@ AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test - - dnl check for ogg library - AC_ARG_ENABLE([ogg], -- AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]), -+ AS_HELP_STRING([--disable-ogg],[Disable ogg support (default: test for libogg)]), - [ want_ogg=$enableval ], [ want_ogg=yes ] ) - - if test "x$want_ogg" != "xno"; then -@@ -300,8 +302,8 @@ if test "x$debug" = xtrue; then - else - CPPFLAGS="-DNDEBUG $CPPFLAGS" - if test "x$GCC" = xyes; then -- CPPFLAGS="-DFLaC__INLINE=__inline__ $CPPFLAGS" -- CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS" -+ CPPFLAGS="-DFLaC__INLINE=__always_inline $CPPFLAGS" -+ CFLAGS="$CFLAGS" - fi - fi - -Index: Makefile.am -=================================================================== ---- Makefile.am.orig -+++ Makefile.am -@@ -30,7 +30,7 @@ - - AUTOMAKE_OPTIONS = foreign 1.7 - --SUBDIRS = doc include m4 man src examples test build obj -+SUBDIRS = doc include m4 man src examples build obj - - DISTCLEANFILES = libtool-disable-static - -Index: src/Makefile.am -=================================================================== ---- src/Makefile.am.orig -+++ src/Makefile.am -@@ -20,7 +20,7 @@ XMMS_DIRS = plugin_common plugin_xmms - endif - - if FLaC__WITH_CPPLIBS --CPPLIBS_DIRS = libFLAC++ test_libFLAC++ -+CPPLIBS_DIRS = libFLAC++ - endif - - SUBDIRS = \ -@@ -31,11 +31,6 @@ SUBDIRS = \ - monkeys_audio_utilities \ - $(XMMS_DIRS) \ - plugin_winamp2 \ -- test_grabbag \ -- test_libs_common \ -- test_libFLAC \ -- test_seeking \ -- test_streams \ - $(CPPLIBS_DIRS) - - EXTRA_DIST = \ -Index: include/share/alloc.h -=================================================================== ---- include/share/alloc.h.orig -+++ include/share/alloc.h -@@ -48,10 +48,14 @@ - #define FLaC__INLINE - #endif - -+#define FLAC_ATTR_MALLOC __attribute__((__malloc__)) -+#define FLAC_ATTR_ALLOC_SIZE(n) __attribute__((alloc_size(n))) -+#define FLAC_ATTR_ALLOC_SIZE2(x,y) __attribute__((alloc_size(x,y))) -+ - /* avoid malloc()ing 0 bytes, see: - * https://www.securecoding.cert.org/confluence/display/seccode/MEM04-A.+Do+not+make+assumptions+about+the+result+of+allocating+0+bytes?focusedCommentId=5407003 - */ --static FLaC__INLINE void *safe_malloc_(size_t size) -+static FLAC_ATTR_MALLOC FLAC_ATTR_ALLOC_SIZE(1) FLaC__INLINE void *safe_malloc_(size_t size) - { - /* malloc(0) is undefined; FLAC src convention is to always allocate */ - if(!size) -@@ -59,7 +63,7 @@ static FLaC__INLINE void *safe_malloc_(s - return malloc(size); - } - --static FLaC__INLINE void *safe_calloc_(size_t nmemb, size_t size) -+static FLAC_ATTR_MALLOC FLAC_ATTR_ALLOC_SIZE2(1,2) FLaC__INLINE void *safe_calloc_(size_t nmemb, size_t size) - { - if(!nmemb || !size) - return malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */ -Index: src/libFLAC/include/private/bitreader.h -=================================================================== ---- src/libFLAC/include/private/bitreader.h.orig -+++ src/libFLAC/include/private/bitreader.h -@@ -80,11 +80,11 @@ FLAC__bool FLAC__bitreader_skip_byte_blo - FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc(FLAC__BitReader *br, FLAC__byte *val, unsigned nvals); /* WATCHOUT: does not CRC the read data! */ - FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, unsigned *val); - FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, unsigned parameter); --FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter); -+FLAC__bool __attribute__((__hot__)) FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter); - #ifndef FLAC__NO_ASM - # ifdef FLAC__CPU_IA32 - # ifdef FLAC__HAS_NASM --FLAC__bool FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter); -+FLAC__bool __attribute__((__hot__)) FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter); - # endif - # endif - #endif -Index: src/libFLAC/include/private/lpc.h -=================================================================== ---- src/libFLAC/include/private/lpc.h.orig -+++ src/libFLAC/include/private/lpc.h -@@ -165,17 +165,17 @@ void FLAC__lpc_compute_residual_from_qlp - * IN data[-order,-1] previously-reconstructed historical samples - * OUT data[0,data_len-1] original signal - */ --void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); --void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -+void __attribute__((__hot__)) FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -+void __attribute__((__hot__)) FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); - #ifndef FLAC__NO_ASM - # ifdef FLAC__CPU_IA32 - # ifdef FLAC__HAS_NASM --void FLAC__lpc_restore_signal_asm_ia32(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); --void FLAC__lpc_restore_signal_asm_ia32_mmx(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -+void __attribute__((__hot__)) FLAC__lpc_restore_signal_asm_ia32(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -+void __attribute__((__hot__)) FLAC__lpc_restore_signal_asm_ia32_mmx(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); - # endif /* FLAC__HAS_NASM */ - # elif defined FLAC__CPU_PPC --void FLAC__lpc_restore_signal_asm_ppc_altivec_16(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); --void FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -+void __attribute__((__hot__)) FLAC__lpc_restore_signal_asm_ppc_altivec_16(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -+void __attribute__((__hot__)) FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); - # endif/* FLAC__CPU_IA32 || FLAC__CPU_PPC */ - #endif /* FLAC__NO_ASM */ - diff --git a/flac.changes b/flac.changes index 1702a10..efc1979 100644 --- a/flac.changes +++ b/flac.changes @@ -1,3 +1,27 @@ +------------------------------------------------------------------- +Sat Dec 8 23:48:01 UTC 2012 - crrodriguez@opensuse.org + +- add xz buildrequires for old distros. + +------------------------------------------------------------------- +Sat Dec 8 21:46:21 UTC 2012 - crrodriguez@opensuse.org + +- Update to current git +* patches deleted: + - flac-1.2.1-asm.patch + - flac-1.2.1-bitreader.patch + - flac-gcc43-fixes.diff + - flac-gcc47.patch + - flac-leaks.patch + - flac-no-xmms.diff + - flac-visibility.patch + - flac-printf-format-fix.diff +All Upstreamed either by us or other distros. + +- Add flac-openssl.patch, do crypto with openssl (not wanted upstream) + +- Restore make check + ------------------------------------------------------------------- Tue Sep 4 10:00:35 UTC 2012 - schwab@linux-m68k.org diff --git a/flac.spec b/flac.spec index 8bfb2fc..2554f30 100644 --- a/flac.spec +++ b/flac.spec @@ -20,7 +20,9 @@ Name: flac BuildRequires: gcc-c++ BuildRequires: libogg-devel BuildRequires: libtool +BuildRequires: openssl-devel BuildRequires: pkg-config +BuildRequires: xz %ifarch %{ix86} BuildRequires: nasm %endif @@ -28,31 +30,17 @@ BuildRequires: nasm %ifarch ppc64 Obsoletes: flac-64bit %endif -Version: 1.2.1 +Version: 1.2.1_git201212051942 Release: 0 # Summary: Free Lossless Audio Codec License: BSD-3-Clause Group: Productivity/Multimedia/Sound/Utilities Url: http://flac.sourceforge.net/ -Source: %{name}-%{version}.tar.bz2 +Source: %{name}-%{version}.tar.xz Source2: baselibs.conf -# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines -Patch0: flac-no-xmms.diff -# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines -Patch1: flac-printf-format-fix.diff -# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines -Patch2: flac-gcc43-fixes.diff -# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines -Patch3: flac-1.2.1-asm.patch -# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines -Patch4: flac-1.2.1-bitreader.patch -# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines -Patch5: flac-ocloexec.patch -Patch6: flac-visibility.patch -Patch7: flac-leaks.patch -# PATCH-FIX-UPSTREAM flac-gcc47.patch dimstar@opensuse.org -- Fix build with gcc 4.7 -Patch9: flac-gcc47.patch +Patch1: flac-ocloexec.patch +Patch2: flac-openssl.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -61,7 +49,7 @@ FLAC is an open source lossless audio codec developed by Josh Coalson. %package -n libFLAC8 Summary: Free Lossless Audio Codec Library Group: System/Libraries -Obsoletes: libflac <= %{version} +Obsoletes: libflac < %{version} Provides: libflac = %{version} %description -n libFLAC8 @@ -90,37 +78,34 @@ FLAC library. %prep %setup -q -%patch0 %patch1 -%patch2 -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch7 -%patch9 -p1 +%patch2 -p1 %build +touch config.rpath autoreconf --force --install %define warn_flags -O3 -W -Wall -Wstrict-prototypes -Wformat-security export CFLAGS="%{optflags} %{warn_flags}" export CXXFLAGS="$CFLAGS" -%configure --disable-thorough-tests --disable-exhaustive-tests\ - --disable-xmms-plugin \ +%configure --disable-thorough-tests \ + --disable-xmms-plugin \ --disable-static \ --disable-rpath \ --with-pic \ - --enable-sse + --enable-sse -make %{?_smp_mflags} +make %{?_smp_mflags} V=1 %install %make_install # documents mkdir -p %{buildroot}%{_docdir} -mv %{buildroot}%{_datadir}/doc/%{name}-%{version} %{buildroot}%{_docdir}/%{name} +mv %{buildroot}%{_datadir}/doc/%{name}-1.2.1 %{buildroot}%{_docdir}/%{name} cp -a AUTHORS README COPYING.* %{buildroot}%{_docdir}/%{name} +%check +make check + %post -n libFLAC8 -p /sbin/ldconfig %postun -n libFLAC8 -p /sbin/ldconfig