21c3c1e777
OKs from landry@, jasper@, sthen@
55 lines
2.1 KiB
Plaintext
55 lines
2.1 KiB
Plaintext
$OpenBSD: patch-plugins_xmms_src_libmp4_c,v 1.3 2010/06/14 17:44:46 sebastia Exp $
|
|
Some reordering of variable initialization fixes build with gcc-2.95
|
|
--- plugins/xmms/src/libmp4.c.orig Tue Jun 5 21:00:18 2007
|
|
+++ plugins/xmms/src/libmp4.c Mon Jun 14 18:30:32 2010
|
|
@@ -207,15 +207,17 @@ static void mp4_getSongTitle(char *filename, char **ti
|
|
mp4ff_callback_t* mp4cb;
|
|
mp4ff_t* infile;
|
|
gint mp4track;
|
|
+ double track_duration;
|
|
+ unsigned long time_scale, length;
|
|
|
|
mp4cb = getMP4FF_cb(mp4file);
|
|
if ((infile = mp4ff_open_read_metaonly(mp4cb)) &&
|
|
((mp4track = getAACTrack(infile)) >= 0)){
|
|
(*title) = getMP4title(infile, filename);
|
|
|
|
- double track_duration = mp4ff_get_track_duration(infile, mp4track);
|
|
- unsigned long time_scale = mp4ff_time_scale(infile, mp4track);
|
|
- unsigned long length = (track_duration * 1000 / time_scale);
|
|
+ track_duration = mp4ff_get_track_duration(infile, mp4track);
|
|
+ time_scale = mp4ff_time_scale(infile, mp4track);
|
|
+ length = (track_duration * 1000 / time_scale);
|
|
(*len) = length;
|
|
}
|
|
if(infile) mp4ff_close(infile);
|
|
@@ -290,7 +292,7 @@ static void *mp4Decode(void *args)
|
|
NeAACDecHandle decoder;
|
|
unsigned char *buffer = NULL;
|
|
guint bufferSize = 0;
|
|
- gulong samplerate;
|
|
+ guint samplerate;
|
|
guchar channels;
|
|
//guint avgBitrate;
|
|
//MP4Duration duration;
|
|
@@ -339,7 +341,7 @@ static void *mp4Decode(void *args)
|
|
mp4_ip.output->open_audio(FMT_S16_NE, samplerate, channels);
|
|
mp4_ip.output->flush(0);
|
|
mp4_ip.set_info(xmmstitle, msDuration, -1, samplerate/1000, channels);
|
|
- g_print("MP4 - %d channels @ %ld Hz\n", channels, samplerate);
|
|
+ g_print("MP4 - %d channels @ %d Hz\n", channels, samplerate);
|
|
|
|
while(bPlaying){
|
|
void* sampleBuffer;
|
|
@@ -414,8 +416,8 @@ end:
|
|
FILE *file = NULL;
|
|
NeAACDecHandle decoder = 0;
|
|
guchar *buffer = 0;
|
|
- gulong bufferconsumed = 0;
|
|
- gulong samplerate = 0;
|
|
+ gint bufferconsumed = 0;
|
|
+ guint samplerate = 0;
|
|
guchar channels;
|
|
gulong buffervalid = 0;
|
|
TitleInput* input;
|