mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-20 07:53:01 +02:00
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into strongswan-5
This commit is contained in:
1160
src/hwdata/pci.ids
1160
src/hwdata/pci.ids
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
48
src/initscripts/init.d/minidlna
Executable file
48
src/initscripts/init.d/minidlna
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
########################################################################
|
||||
# Begin $rc_base/init.d/minidlna
|
||||
#
|
||||
# Description : minidlna - UPNP/DLNA streaming server
|
||||
#
|
||||
# Authors : Michael Tremer <michael.tremer@ipfire.org>
|
||||
#
|
||||
# Version : 01.00
|
||||
#
|
||||
########################################################################
|
||||
|
||||
. /etc/sysconfig/rc
|
||||
. ${rc_functions}
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
boot_mesg "Starting minidlna..."
|
||||
loadproc /usr/sbin/minidlna
|
||||
;;
|
||||
|
||||
stop)
|
||||
boot_mesg "Stopping minidlna..."
|
||||
killproc /usr/sbin/minidlna
|
||||
;;
|
||||
|
||||
reload)
|
||||
boot_mesg "Reloading minidlna..."
|
||||
reloadproc /usr/sbin/minidlna
|
||||
;;
|
||||
|
||||
restart)
|
||||
${0} stop
|
||||
sleep 1
|
||||
${0} start
|
||||
;;
|
||||
|
||||
status)
|
||||
statusproc /usr/sbin/minidlna
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: ${0} {start|stop|reload|restart|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# End $rc_base/init.d/minidlna
|
||||
101
src/initscripts/init.d/network-vlans
Executable file
101
src/initscripts/init.d/network-vlans
Executable file
@@ -0,0 +1,101 @@
|
||||
#!/bin/bash
|
||||
############################################################################
|
||||
# #
|
||||
# This file is part of the IPFire Firewall. #
|
||||
# #
|
||||
# IPFire is free software; you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation; either version 2 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# IPFire is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with IPFire; if not, write to the Free Software #
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
# #
|
||||
# Copyright (C) 2012 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
############################################################################
|
||||
|
||||
CONFIG_FILE="/var/ipfire/ethernet/vlans"
|
||||
|
||||
# Skip immediately if no configuration file has been found.
|
||||
[ -e "${CONFIG_FILE}" ] || exit 0
|
||||
|
||||
eval $(readhash ${CONFIG_FILE})
|
||||
|
||||
# This is start or stop.
|
||||
action=${1}
|
||||
|
||||
for interface in green0 blue0 orange0; do
|
||||
case "${interface}" in
|
||||
green*)
|
||||
PARENT_DEV=${GREEN_PARENT_DEV}
|
||||
VLAN_ID=${GREEN_VLAN_ID}
|
||||
MAC_ADDRESS=${GREEN_MAC_ADDRESS}
|
||||
;;
|
||||
blue*)
|
||||
PARENT_DEV=${BLUE_PARENT_DEV}
|
||||
VLAN_ID=${BLUE_VLAN_ID}
|
||||
MAC_ADDRESS=${BLUE_MAC_ADDRESS}
|
||||
;;
|
||||
orange*)
|
||||
PARENT_DEV=${ORANGE_PARENT_DEV}
|
||||
VLAN_ID=${ORANGE_VLAN_ID}
|
||||
MAC_ADDRESS=${ORANGE_MAC_ADDRESS}
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${action}" in
|
||||
start)
|
||||
# Check if the interface does already exists.
|
||||
# If so, we skip creating it.
|
||||
if [ -d "/sys/class/net/${interface}" ]; then
|
||||
echo "Interface ${interface} already exists."
|
||||
continue
|
||||
fi
|
||||
|
||||
# Check if the parent interface exists.
|
||||
if [ -z "${PARENT_DEV}" ] || [ ! -d "/sys/class/net/${PARENT_DEV}" ]; then
|
||||
echo "${interface}: Parent device is not set or does not exist: ${PARENT_DEV}"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -z "${VLAN_ID}" ]; then
|
||||
echo "${interface}: You did not set the VLAN ID."
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Creating VLAN interface ${interface}..."
|
||||
vconfig add ${PARENT_DEV} ${VLAN_ID}
|
||||
ip link set ${PARENT_DEV}.${VLAN_ID} name ${interface}
|
||||
|
||||
if [ -n "${MAC_ADDRESS}" ]; then
|
||||
ip link set ${interface} address ${MAC_ADDRESS}
|
||||
fi
|
||||
|
||||
# Bring up the parent device.
|
||||
ip link set ${PARENT_DEV} up
|
||||
;;
|
||||
|
||||
stop)
|
||||
if [ ! -e "/proc/net/vlan/${interface}" ]; then
|
||||
echo "${interface} is not a VLAN interface. Skipping."
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Removing VLAN interface ${interface}..."
|
||||
ip link set ${interface} down
|
||||
vconfig rem ${interface}
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Invalid action: ${action}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@@ -32,7 +32,8 @@ SUID_PROGS = setdmzholes setportfw setxtaccess \
|
||||
wirelessctrl getipstat getiptstate qosctrl launch-ether-wake \
|
||||
redctrl syslogdctrl extrahdctrl sambactrl upnpctrl tripwirectrl \
|
||||
smartctrl clamavctrl addonctrl pakfire mpfirectrl wlanapctrl \
|
||||
setaliases urlfilterctrl updxlratorctrl fireinfoctrl rebuildroutes
|
||||
setaliases urlfilterctrl updxlratorctrl fireinfoctrl rebuildroutes \
|
||||
getconntracktable
|
||||
SUID_UPDX = updxsetperms
|
||||
|
||||
install : all
|
||||
@@ -160,3 +161,6 @@ fireinfoctrl: fireinfoctrl.c setuid.o ../install+setup/libsmooth/varval.o
|
||||
|
||||
rebuildroutes: rebuildroutes.c setuid.o ../install+setup/libsmooth/varval.o
|
||||
$(COMPILE) -I../install+setup/libsmooth/ rebuildroutes.c setuid.o ../install+setup/libsmooth/varval.o -o $@
|
||||
|
||||
getconntracktable: getconntracktable.c setuid.o ../install+setup/libsmooth/varval.o
|
||||
$(COMPILE) -I../install+setup/libsmooth/ getconntracktable.c setuid.o ../install+setup/libsmooth/varval.o -o $@
|
||||
|
||||
31
src/misc-progs/getconntracktable.c
Normal file
31
src/misc-progs/getconntracktable.c
Normal file
@@ -0,0 +1,31 @@
|
||||
/* IPFire helper program - getconntracktable
|
||||
*
|
||||
* This program is distributed under the terms of the GNU General Public
|
||||
* Licence. See the file COPYING for details.
|
||||
*
|
||||
* The kernel's connection tracking table is not readable by
|
||||
* non-root users. So this helper will just read and output it.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "setuid.h"
|
||||
|
||||
int main(void) {
|
||||
if (!(initsetuid()))
|
||||
exit(1);
|
||||
|
||||
FILE *fp = fopen("/proc/net/nf_conntrack", "r");
|
||||
if (fp == NULL) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Read content line by line and write it to stdout. */
|
||||
char linebuf[STRING_SIZE];
|
||||
while (fgets(linebuf, STRING_SIZE, fp)) {
|
||||
printf("%s", linebuf);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
32
src/paks/minidlna/install.sh
Normal file
32
src/paks/minidlna/install.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
############################################################################
|
||||
# #
|
||||
# This file is part of the IPFire Firewall. #
|
||||
# #
|
||||
# IPFire is free software; you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation; either version 2 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# IPFire is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with IPFire; if not, write to the Free Software #
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
# #
|
||||
# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
|
||||
# #
|
||||
############################################################################
|
||||
#
|
||||
. /opt/pakfire/lib/functions.sh
|
||||
extract_files
|
||||
[ -d /var/mp3 ] || ( mkdir /var/mp3 && chown nobody.nobody /var/mp3 )
|
||||
|
||||
start_service ${NAME}
|
||||
|
||||
ln -svf ../init.d/minidlna /etc/rc.d/rc0.d/K00minidlna
|
||||
ln -svf ../init.d/minidlna /etc/rc.d/rc3.d/S99minidlna
|
||||
ln -svf ../init.d/minidlna /etc/rc.d/rc6.d/K00minidlna
|
||||
27
src/paks/minidlna/uninstall.sh
Normal file
27
src/paks/minidlna/uninstall.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
############################################################################
|
||||
# #
|
||||
# This file is part of the IPFire Firewall. #
|
||||
# #
|
||||
# IPFire is free software; you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation; either version 2 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# IPFire is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with IPFire; if not, write to the Free Software #
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
# #
|
||||
# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
|
||||
# #
|
||||
############################################################################
|
||||
#
|
||||
. /opt/pakfire/lib/functions.sh
|
||||
stop_service ${NAME}
|
||||
remove_files
|
||||
rm -rf /etc/rc.d/rc*.d/*minidlna
|
||||
25
src/paks/minidlna/update.sh
Normal file
25
src/paks/minidlna/update.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
############################################################################
|
||||
# #
|
||||
# This file is part of the IPFire Firewall. #
|
||||
# #
|
||||
# IPFire is free software; you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation; either version 2 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# IPFire is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with IPFire; if not, write to the Free Software #
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
# #
|
||||
# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
|
||||
# #
|
||||
############################################################################
|
||||
#
|
||||
./uninstall.sh
|
||||
./install.sh
|
||||
73
src/patches/flac-1.2.1-asm.patch
Normal file
73
src/patches/flac-1.2.1-asm.patch
Normal file
@@ -0,0 +1,73 @@
|
||||
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
|
||||
558
src/patches/flac-1.2.1-bitreader.patch
Normal file
558
src/patches/flac-1.2.1-bitreader.patch
Normal file
@@ -0,0 +1,558 @@
|
||||
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)
|
||||
45
src/patches/flac-1.2.1-cflags.patch
Normal file
45
src/patches/flac-1.2.1-cflags.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
diff -up flac-1.2.1/src/libFLAC/Makefile.am.cflags flac-1.2.1/src/libFLAC/Makefile.am
|
||||
--- flac-1.2.1/src/libFLAC/Makefile.am.cflags 2007-09-14 23:06:17.000000000 +0200
|
||||
+++ flac-1.2.1/src/libFLAC/Makefile.am 2008-03-17 14:19:29.000000000 +0100
|
||||
@@ -41,7 +41,7 @@ CPUCFLAGS = -faltivec -force_cpusubtype_
|
||||
else
|
||||
# Linux-gcc for PPC does not have -force_cpusubtype_ALL, it is Darwin-specific
|
||||
#@@@ PPC optimizations temporarily disabled
|
||||
-CPUCFLAGS = -maltivec -mabi=altivec -DFLAC__NO_ASM
|
||||
+CPUCFLAGS = -DFLAC__NO_ASM
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -69,7 +69,7 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
-libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@
|
||||
+libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ libFLAC_extracflags.la
|
||||
|
||||
SUBDIRS = $(ARCH_SUBDIRS) include .
|
||||
|
||||
@@ -112,7 +112,10 @@ libFLAC_la_SOURCES = \
|
||||
metadata_iterators.c \
|
||||
metadata_object.c \
|
||||
stream_decoder.c \
|
||||
- stream_encoder.c \
|
||||
stream_encoder_framing.c \
|
||||
window.c \
|
||||
$(extra_ogg_sources)
|
||||
+
|
||||
+noinst_LTLIBRARIES = libFLAC_extracflags.la
|
||||
+libFLAC_extracflags_la_SOURCES = stream_encoder.c
|
||||
+libFLAC_extracflags_la_CFLAGS = $(AM_CFLAGS) -funroll-loops
|
||||
diff -up flac-1.2.1/configure.in.cflags flac-1.2.1/configure.in
|
||||
--- flac-1.2.1/configure.in.cflags 2007-09-13 17:48:42.000000000 +0200
|
||||
+++ flac-1.2.1/configure.in 2008-03-17 14:17:08.000000000 +0100
|
||||
@@ -301,7 +301,7 @@ 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"
|
||||
+ CFLAGS="-Wall -W -Winline $CFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
11
src/patches/flac-1.2.1-gcc43.patch
Normal file
11
src/patches/flac-1.2.1-gcc43.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
diff -up flac-1.2.1/examples/cpp/encode/file/main.cpp.gcc43 flac-1.2.1/examples/cpp/encode/file/main.cpp
|
||||
--- flac-1.2.1/examples/cpp/encode/file/main.cpp.gcc43 2007-09-13 17:58:03.000000000 +0200
|
||||
+++ flac-1.2.1/examples/cpp/encode/file/main.cpp 2008-01-08 10:27:39.000000000 +0100
|
||||
@@ -29,6 +29,7 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
+#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "FLAC++/metadata.h"
|
||||
#include "FLAC++/encoder.h"
|
||||
39
src/patches/flac-1.2.1-hidesyms.patch
Normal file
39
src/patches/flac-1.2.1-hidesyms.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
diff -up flac-1.2.1/src/libFLAC/include/private/ogg_helper.h.hidesyms flac-1.2.1/src/libFLAC/include/private/ogg_helper.h
|
||||
--- flac-1.2.1/src/libFLAC/include/private/ogg_helper.h.hidesyms 2007-02-02 07:22:40.000000000 +0100
|
||||
+++ flac-1.2.1/src/libFLAC/include/private/ogg_helper.h 2008-01-29 15:27:13.000000000 +0100
|
||||
@@ -35,9 +35,13 @@
|
||||
#include <ogg/ogg.h>
|
||||
#include "FLAC/stream_encoder.h" /* for FLAC__StreamEncoder */
|
||||
|
||||
+__attribute__((__visibility__("hidden")))
|
||||
void simple_ogg_page__init(ogg_page *page);
|
||||
+__attribute__((__visibility__("hidden")))
|
||||
void simple_ogg_page__clear(ogg_page *page);
|
||||
+__attribute__((__visibility__("hidden")))
|
||||
FLAC__bool simple_ogg_page__get_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderReadCallback read_callback, void *client_data);
|
||||
+__attribute__((__visibility__("hidden")))
|
||||
FLAC__bool simple_ogg_page__set_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderWriteCallback write_callback, void *client_data);
|
||||
|
||||
#endif
|
||||
diff -up flac-1.2.1/src/libFLAC/include/private/bitreader.h.hidesyms flac-1.2.1/src/libFLAC/include/private/bitreader.h
|
||||
--- flac-1.2.1/src/libFLAC/include/private/bitreader.h.hidesyms 2007-07-10 22:22:19.000000000 +0200
|
||||
+++ flac-1.2.1/src/libFLAC/include/private/bitreader.h 2008-01-29 15:27:13.000000000 +0100
|
||||
@@ -95,5 +95,6 @@ FLAC__bool FLAC__bitreader_read_golomb_u
|
||||
FLAC__bool FLAC__bitreader_read_utf8_uint32(FLAC__BitReader *br, FLAC__uint32 *val, FLAC__byte *raw, unsigned *rawlen);
|
||||
FLAC__bool FLAC__bitreader_read_utf8_uint64(FLAC__BitReader *br, FLAC__uint64 *val, FLAC__byte *raw, unsigned *rawlen);
|
||||
|
||||
+__attribute__((__visibility__("hidden")))
|
||||
FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br);
|
||||
#endif
|
||||
diff -up flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm.hidesyms flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm
|
||||
--- flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm.hidesyms 2008-01-29 15:27:13.000000000 +0100
|
||||
+++ flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm 2008-01-29 15:28:32.000000000 +0100
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
data_section
|
||||
|
||||
-cglobal precompute_partition_info_sums_32bit_asm_ia32_
|
||||
+cglobal precompute_partition_info_sums_32bit_asm_ia32_:function hidden
|
||||
|
||||
code_section
|
||||
|
||||
41
src/patches/flac-1.2.1-tests.patch
Normal file
41
src/patches/flac-1.2.1-tests.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
diff -up flac-1.2.1/test/test_seeking.sh.tests flac-1.2.1/test/test_seeking.sh
|
||||
--- flac-1.2.1/test/test_seeking.sh.tests 2007-09-11 09:33:04.000000000 +0200
|
||||
+++ flac-1.2.1/test/test_seeking.sh 2008-01-29 13:52:03.000000000 +0100
|
||||
@@ -103,7 +103,7 @@ tiny_seek_count=100
|
||||
if [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then
|
||||
small_seek_count=10000
|
||||
else
|
||||
- small_seek_count=100000
|
||||
+ small_seek_count=100
|
||||
fi
|
||||
|
||||
for suffix in '' '-s' ; do
|
||||
diff -up flac-1.2.1/test/test_streams.sh.tests flac-1.2.1/test/test_streams.sh
|
||||
--- flac-1.2.1/test/test_streams.sh.tests 2007-06-16 21:58:39.000000000 +0200
|
||||
+++ flac-1.2.1/test/test_streams.sh 2008-03-17 13:57:39.000000000 +0100
|
||||
@@ -39,6 +39,10 @@ if [ x"$FLAC__TEST_LEVEL" = x ] ; then
|
||||
FLAC__TEST_LEVEL=1
|
||||
fi
|
||||
|
||||
+if [ "$FLAC__TEST_LEVEL" -eq 0 ] ; then
|
||||
+ exit 0
|
||||
+fi
|
||||
+
|
||||
flac --help 1>/dev/null 2>/dev/null || die "ERROR can't find flac executable"
|
||||
|
||||
run_flac ()
|
||||
diff -up flac-1.2.1/src/test_streams/main.c.tests flac-1.2.1/src/test_streams/main.c
|
||||
--- flac-1.2.1/src/test_streams/main.c.tests 2007-08-31 07:54:49.000000000 +0200
|
||||
+++ flac-1.2.1/src/test_streams/main.c 2008-01-29 13:53:46.000000000 +0100
|
||||
@@ -898,9 +898,9 @@ int main(int argc, char *argv[])
|
||||
if(!generate_noise("noise.raw", 65536 * 8 * 3)) return 1;
|
||||
if(!generate_noise("noise8m32.raw", 32)) return 1;
|
||||
if(!generate_wackywavs()) return 1;
|
||||
- for(channels = 1; channels <= 8; channels++) {
|
||||
+ for(channels = 1; channels <= 2; channels++) {
|
||||
unsigned bits_per_sample;
|
||||
- for(bits_per_sample = 4; bits_per_sample <= 24; bits_per_sample++) {
|
||||
+ for(bits_per_sample = 8; bits_per_sample <= 24; bits_per_sample += 8) {
|
||||
static const unsigned nsamples[] = { 1, 111, 4777 } ;
|
||||
unsigned samples;
|
||||
for(samples = 0; samples < sizeof(nsamples)/sizeof(nsamples[0]); samples++) {
|
||||
22
src/patches/icecream-0.9.7-platform-arm.patch
Normal file
22
src/patches/icecream-0.9.7-platform-arm.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
Index: services/scheduler.cpp
|
||||
===================================================================
|
||||
--- services/scheduler.cpp (revision 1310078)
|
||||
+++ services/scheduler.cpp (working copy)
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "config.h"
|
||||
#include "bench.h"
|
||||
|
||||
-#define DEBUG_SCHEDULER 0
|
||||
+#define DEBUG_SCHEDULER 1
|
||||
|
||||
/* TODO:
|
||||
* leak check
|
||||
@@ -613,6 +613,8 @@
|
||||
|
||||
platform_map.insert( make_pair( string( "ppc" ), string( "ppc64" ) ) );
|
||||
platform_map.insert( make_pair( string( "s390" ), string( "s390x" ) ) );
|
||||
+
|
||||
+ platform_map.insert( make_pair( string( "armv5tel"), string( "armv7l" ) ) );
|
||||
}
|
||||
|
||||
multimap<string, string>::const_iterator end = platform_map.upper_bound( target );
|
||||
Reference in New Issue
Block a user