summaryrefslogtreecommitdiff
path: root/src/libreal/audio_decoder.c
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-03-16 19:31:57 +0000
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-03-16 19:31:57 +0000
commit51d097f9144193c98d881f14c4e4bd6b579574f2 (patch)
tree13c3976e940abc25f7a9942e046c6e2b3d4b0e39 /src/libreal/audio_decoder.c
parent8255b3f2fc3d31bf42e786c472a2b4252511bec9 (diff)
downloadxine-lib-51d097f9144193c98d881f14c4e4bd6b579574f2.tar.gz
xine-lib-51d097f9144193c98d881f14c4e4bd6b579574f2.tar.bz2
There's no need to check if the shared object to open is 32 or 64 bits, as dlopen() will not load a codec if it's not loadable in the current process (which means it won't load 64-bit codecs on 32-bit xine, or 32-bit codecs on 64-bit xine).
CVS patchset: 8678 CVS date: 2007/03/16 19:31:57
Diffstat (limited to 'src/libreal/audio_decoder.c')
-rw-r--r--src/libreal/audio_decoder.c54
1 files changed, 1 insertions, 53 deletions
diff --git a/src/libreal/audio_decoder.c b/src/libreal/audio_decoder.c
index 8b8e40126..d60e8f8e1 100644
--- a/src/libreal/audio_decoder.c
+++ b/src/libreal/audio_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_decoder.c,v 1.51 2007/02/20 00:34:57 dgp85 Exp $
+ * $Id: audio_decoder.c,v 1.52 2007/03/16 19:31:57 dgp85 Exp $
*
* thin layer to use real binary-only codecs in xine
*
@@ -32,9 +32,6 @@
#include <fcntl.h>
#include <unistd.h>
#include <dlfcn.h>
-#ifdef __x86_64__
- #include <elf.h>
-#endif
#define LOG_MODULE "real_audio_decoder"
#define LOG_VERBOSE
@@ -121,49 +118,6 @@ void __builtin_delete (void *foo) {
free (foo);
}
-#ifdef __x86_64__
-/* (gb) quick-n-dirty check to be run natively */
-static int is_x86_64_object_(FILE *f)
-{
- Elf64_Ehdr *hdr = malloc(sizeof(Elf64_Ehdr));
- if (hdr == NULL)
- return 0;
-
- if (fseek(f, 0, SEEK_SET) != 0) {
- free(hdr);
- return 0;
- }
-
- if (fread(hdr, sizeof(Elf64_Ehdr), 1, f) != 1) {
- free(hdr);
- return 0;
- }
-
- if (hdr->e_ident[EI_MAG0] != ELFMAG0 ||
- hdr->e_ident[EI_MAG1] != ELFMAG1 ||
- hdr->e_ident[EI_MAG2] != ELFMAG2 ||
- hdr->e_ident[EI_MAG3] != ELFMAG3) {
- free(hdr);
- return 0;
- }
-
- return hdr->e_machine == EM_X86_64;
-}
-
-static inline int is_x86_64_object(const char *filename)
-{
- FILE *f;
- int ret;
-
- if ((f = fopen(filename, "r")) == NULL)
- return 0;
-
- ret = is_x86_64_object_(f);
- fclose(f);
- return ret;
-}
-#endif
-
static int load_syms_linux (realdec_decoder_t *this, char *codec_name,
const char *alt_codec_name) {
@@ -176,12 +130,6 @@ static int load_syms_linux (realdec_decoder_t *this, char *codec_name,
if (stat(path, &sb))
snprintf (path, sizeof(path), "%s/%s", entry->str_value, alt_codec_name);
-#ifdef __x86_64__
- /* check whether it's a real x86-64 library */
- if (!is_x86_64_object(path))
- return 0;
-#endif
-
lprintf ("(audio) opening shared obj '%s'\n", path);
this->ra_handle = dlopen (path, RTLD_LAZY);