changeset 1188:22a470857579 trunk

- fix the bug that aac plugin had failed to get proper playtime length on AMD64. - fix typedef conflict. uint32_t isn't unsigned long on 64bit machines. - resolve all warnings. - unnecessary code has been removed.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Mon, 18 Jun 2007 21:53:26 +0900
parents 875baf383f0c
children af5bd4592100
files src/aac/include/neaacdec.h src/aac/libfaad2/Makefile src/aac/libfaad2/common.h src/aac/libfaad2/sbr_hfadj.c src/aac/libfaad2/specrec.c src/aac/libfaad2/structs.h src/aac/mp4ff/Makefile src/aac/mp4ff/mp4meta.c src/aac/src/Makefile src/aac/src/libmp4.c
diffstat 10 files changed, 18 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/src/aac/include/neaacdec.h	Mon Jun 18 15:15:32 2007 +0900
+++ b/src/aac/include/neaacdec.h	Mon Jun 18 21:53:26 2007 +0900
@@ -215,7 +215,7 @@
 /* Init the library using a DecoderSpecificInfo */
 signed char NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, unsigned char *pBuffer,
                                unsigned long SizeOfDecoderSpecificInfo,
-                               unsigned long *samplerate, unsigned char *channels);
+                               unsigned int *samplerate, unsigned char *channels);
 
 /* Init the library for DRM */
 signed char NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, unsigned long samplerate,
--- a/src/aac/libfaad2/Makefile	Mon Jun 18 15:15:32 2007 +0900
+++ b/src/aac/libfaad2/Makefile	Mon Jun 18 21:53:26 2007 +0900
@@ -1,7 +1,7 @@
 include ../../../mk/rules.mk
 include ../../../mk/init.mk
 
-CFLAGS += -I../include -I../../.. -I. $(PICFLAGS)
+CFLAGS += -I../include -I../../.. -I. $(PICFLAGS) -Wall
 
 OBJECTIVE_LIBS_NOINST = libfaad.a
 
--- a/src/aac/libfaad2/common.h	Mon Jun 18 15:15:32 2007 +0900
+++ b/src/aac/libfaad2/common.h	Mon Jun 18 21:53:26 2007 +0900
@@ -228,7 +228,7 @@
 # else
 /* we need these... */
 typedef unsigned long long uint64_t;
-typedef unsigned long uint32_t;
+typedef unsigned int uint32_t;
 typedef unsigned short uint16_t;
 typedef unsigned char uint8_t;
 typedef long long int64_t;
--- a/src/aac/libfaad2/sbr_hfadj.c	Mon Jun 18 15:15:32 2007 +0900
+++ b/src/aac/libfaad2/sbr_hfadj.c	Mon Jun 18 21:53:26 2007 +0900
@@ -1170,7 +1170,6 @@
             real_t den = 0;
             real_t acc1 = 0;
             real_t acc2 = 0;
-            uint8_t current_res_band_size = 0;
 
             uint8_t ml1, ml2;
 
--- a/src/aac/libfaad2/specrec.c	Mon Jun 18 15:15:32 2007 +0900
+++ b/src/aac/libfaad2/specrec.c	Mon Jun 18 21:53:26 2007 +0900
@@ -409,7 +409,7 @@
     }
 }
 
-/* iquant() *
+/* iquant() */
 /* output = sign(input)*abs(input)^(4/3) */
 /**/
 static INLINE real_t iquant(int16_t q, const real_t *tab, uint8_t *error)
--- a/src/aac/libfaad2/structs.h	Mon Jun 18 15:15:32 2007 +0900
+++ b/src/aac/libfaad2/structs.h	Mon Jun 18 21:53:26 2007 +0900
@@ -312,7 +312,7 @@
     /* Audio Specific Info */
     /*uint8_t*/ unsigned char objectTypeIndex;
     /*uint8_t*/ unsigned char samplingFrequencyIndex;
-    /*uint32_t*/ unsigned long samplingFrequency;
+    /*uint32_t*/ unsigned int samplingFrequency;
     /*uint8_t*/ unsigned char channelsConfiguration;
 
     /* GA Specific Info */
@@ -333,7 +333,7 @@
 typedef struct NeAACDecConfiguration
 {
     /*uint8_t*/ unsigned char defObjectType;
-    /*uint32_t*/ unsigned long defSampleRate;
+    /*uint32_t*/ unsigned int defSampleRate;
     /*uint8_t*/ unsigned char outputFormat;
     /*uint8_t*/ unsigned char downMatrix;
     /*uint8_t*/ unsigned char useOldADTSFormat;
@@ -342,11 +342,11 @@
 
 typedef struct NeAACDecFrameInfo
 {
-    /*uint32_t*/ unsigned long bytesconsumed;
+    /*uint32_t*/ unsigned int bytesconsumed;
     /*uint32_t*/ unsigned long samples;
     /*uint8_t*/ unsigned char channels;
     /*uint8_t*/ unsigned char error;
-    /*uint32_t*/ unsigned long samplerate;
+    /*uint32_t*/ unsigned int samplerate;
 
     /* SBR: 0: off, 1: on; normal, 2: on; downsampled */
     /*uint8_t*/ unsigned char sbr;
--- a/src/aac/mp4ff/Makefile	Mon Jun 18 15:15:32 2007 +0900
+++ b/src/aac/mp4ff/Makefile	Mon Jun 18 21:53:26 2007 +0900
@@ -8,6 +8,6 @@
 
 OBJECTS = ${SOURCES:.c=.o}
 
-CFLAGS += $(PICFLAGS) -DUSE_TAGGING=1 -fsigned-char -I../../..
+CFLAGS += $(PICFLAGS) -DUSE_TAGGING=1 -fsigned-char -I../../.. -Wall
 
 include ../../../mk/objective.mk
--- a/src/aac/mp4ff/mp4meta.c	Mon Jun 18 15:15:32 2007 +0900
+++ b/src/aac/mp4ff/mp4meta.c	Mon Jun 18 21:53:26 2007 +0900
@@ -294,7 +294,7 @@
 		if (!done)
 		{
 			if (name == NULL) mp4ff_set_metadata_name(f, parent_atom_type, &name);
-			if (name) mp4ff_tag_add_field_len(&(f->tags), name, data, datalen);
+			if (name) mp4ff_tag_add_field_len(&(f->tags), (char *)name, (char *)data, datalen);
 		}
 
 		free(data);
--- a/src/aac/src/Makefile	Mon Jun 18 15:15:32 2007 +0900
+++ b/src/aac/src/Makefile	Mon Jun 18 21:53:26 2007 +0900
@@ -16,6 +16,6 @@
 
 LIBDEP = ../libfaad2/libfaad.a ../mp4ff/libmp4ff.a
 
-CFLAGS += $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../.. -I../include -I../libfaad -I../mp4ff
+CFLAGS += $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../.. -I../include -I../libfaad -I../mp4ff -Wall
 
 include ../../../mk/objective.mk
--- a/src/aac/src/libmp4.c	Mon Jun 18 15:15:32 2007 +0900
+++ b/src/aac/src/libmp4.c	Mon Jun 18 21:53:26 2007 +0900
@@ -12,6 +12,7 @@
 #include <audacious/titlestring.h>
 #include <audacious/vfs.h>
 #include <audacious/i18n.h>
+#include <audacious/strings.h>
 
 #define MP4_VERSION VERSION
 
@@ -38,7 +39,6 @@
 static void        mp4_stop(InputPlayback *);
 static void        mp4_pause(InputPlayback *, short);
 static void        mp4_seek(InputPlayback *, int);
-static int         mp4_get_time(InputPlayback *);
 static void        mp4_cleanup(void);
 static void        mp4_get_song_title_len(char *filename, char **, int *);
 static TitleInput* mp4_get_song_tuple(char *);
@@ -48,7 +48,6 @@
 
 static void *   mp4_decode(void *);
 static gchar *  mp4_get_song_title(char *filename);
-static void     audmp4_file_info_box(gchar *);
 gboolean        buffer_playing;
 
 InputPlugin mp4_ip =
@@ -66,7 +65,6 @@
     .get_song_tuple = mp4_get_song_tuple,
     .is_our_file_from_vfs = mp4_is_our_fd,
     .vfs_extensions = fmts,
-//    .get_time = mp4_get_time,
 };
 
 InputPlugin *mp4_iplist[] = { &mp4_ip, NULL };
@@ -317,14 +315,6 @@
         xmms_usleep(10000);
 }
 
-static int mp4_get_time(InputPlayback *playback)
-{
-    if(!buffer_playing)
-        return (-1);
-    else
-        return (playback->output->output_time());
-}
-
 static void mp4_cleanup(void)
 {
 }
@@ -374,8 +364,8 @@
         gint mp4track= getAACTrack(mp4file);
         gint numSamples = mp4ff_num_samples(mp4file, mp4track);
         guint framesize = 1024;
-        gulong samplerate;
-        guchar channels;
+        guint samplerate = 0;
+        guchar channels = 0;
         gint msDuration;
         mp4AudioSpecificConfig mp4ASC;
         gchar *tmpval;
@@ -513,10 +503,10 @@
     mp4AudioSpecificConfig mp4ASC;
     guchar      *buffer = NULL;
     guint       bufferSize = 0;
-    gulong      samplerate;
-    guchar      channels;
+    guint       samplerate = 0;
+    guchar      channels = 0;
     gulong      msDuration;
-    gulong      numSamples;
+    guint       numSamples;
     gulong      sampleID = 1;
     guint       framesize = 1024;
 
@@ -664,14 +654,11 @@
     guchar      streambuffer[BUFFER_SIZE];
     gulong      bufferconsumed = 0;
     gulong      samplerate = 0;
-    guchar      channels;
+    guchar      channels = 0;
     gulong      buffervalid = 0;
-    TitleInput* input;
     gchar       *ttemp = NULL, *stemp = NULL;
     gchar       *temp = g_strdup(filename);
-    gchar       *ext  = strrchr(temp, '.');
     gchar       *xmmstitle = NULL;
-    faacDecConfigurationPtr config;
     gboolean    remote = str_has_prefix_nocase(filename, "http:") ||
 			 str_has_prefix_nocase(filename, "https:");