Mercurial > audlegacy-plugins
changeset 1237:0d5b0f861bf0
- quick fix for link breakage to libaudid3tag.so when --prefix is specified.
- adaptation for file:// scheme in cuesheet and tta.
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Thu, 12 Jul 2007 04:36:03 +0900 |
parents | e6c69ef37b7b |
children | 5d9fb703a7cc d4501b0e98b4 |
files | configure.ac src/cue/cuesheet.c src/madplug/Makefile src/tta/Makefile src/tta/libtta.c src/tta/ttadec.c src/tta/ttalib.h |
diffstat | 7 files changed, 23 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.ac Wed Jul 11 07:55:13 2007 -0500 +++ b/configure.ac Thu Jul 12 04:36:03 2007 +0900 @@ -217,7 +217,7 @@ PICFLAGS="-fPIC -DPIC" PICLDFLAGS="-fPIC -DPIC -shared" LIBLDFLAGS="-fPIC -DPIC -shared" - AUDLDFLAGS="-Wl,-export-dynamic -Wl,-rpath=\${libdir}" + AUDLDFLAGS="-Wl,-export-dynamic -Wl,-rpath=\${libdir},-rpath=\${plugindir}" SHARED_SUFFIX=".so" ;; esac
--- a/src/cue/cuesheet.c Wed Jul 11 07:55:13 2007 -0500 +++ b/src/cue/cuesheet.c Thu Jul 12 04:36:03 2007 +0900 @@ -447,7 +447,7 @@ cur_cue_track = track; cache_cue_file(path2); - if (cue_file == NULL || !g_file_test(cue_file, G_FILE_TEST_EXISTS)) + if (cue_file == NULL || !vfs_file_test(cue_file, G_FILE_TEST_EXISTS)) return; real_ip_plugin = input_check_file(cue_file, FALSE);
--- a/src/madplug/Makefile Wed Jul 11 07:55:13 2007 -0500 +++ b/src/madplug/Makefile Thu Jul 12 04:36:03 2007 +0900 @@ -19,6 +19,7 @@ CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(SIMD_CFLAGS) -I../../intl -I../.. -Wall +LDFLAGS += $(AUDLDFLAGS) LIBADD = -L/opt/local/lib -L$(plugindir) -laudid3tag -lmad $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) include ../../mk/objective.mk
--- a/src/tta/Makefile Wed Jul 11 07:55:13 2007 -0500 +++ b/src/tta/Makefile Thu Jul 12 04:36:03 2007 +0900 @@ -11,6 +11,7 @@ CFLAGS += -fPIC -DPIC $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. +LDFLAGS += $(AUDLDFLAGS) LIBADD = -L$(plugindir) -laudid3tag $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) include ../../mk/objective.mk
--- a/src/tta/libtta.c Wed Jul 11 07:55:13 2007 -0500 +++ b/src/tta/libtta.c Thu Jul 12 04:36:03 2007 +0900 @@ -460,7 +460,7 @@ static void play_file (InputPlayback *playback) { - char *filename = playback->filename; + gchar *filename = playback->filename; char *title; int datasize, origsize, bitrate; TitleInput *tuple = NULL; @@ -469,7 +469,7 @@ //////////////////////////////////////// // open TTA file - if (open_tta_file (filename, &info, 0) < 0) + if (open_tta_file (filename, &info, 0) > 0) { tta_error (info.STATE); close_tta_file (&info);
--- a/src/tta/ttadec.c Wed Jul 11 07:55:13 2007 -0500 +++ b/src/tta/ttadec.c Thu Jul 12 04:36:03 2007 +0900 @@ -87,7 +87,7 @@ __inline void get_binary(unsigned int *value, unsigned int bits) { while (bit_count < bits) { if (bitpos == iso_buffers_end) { - int res = fread(isobuffers, 1, + int res = vfs_fread(isobuffers, 1, ISO_BUFFERS_SIZE, ttainfo->HANDLE); if (!res) { ttainfo->STATE = READ_ERROR; @@ -113,7 +113,7 @@ while (!(bit_cache ^ bit_mask[bit_count])) { if (bitpos == iso_buffers_end) { - int res = fread(isobuffers, 1, + int res = vfs_fread(isobuffers, 1, ISO_BUFFERS_SIZE, ttainfo->HANDLE); if (!res) { ttainfo->STATE = READ_ERROR; @@ -145,7 +145,7 @@ rbytes = iso_buffers_end - bitpos; if (rbytes < sizeof(int)) { memcpy(isobuffers, bitpos, 4); - res = fread(isobuffers + rbytes, 1, + res = vfs_fread(isobuffers + rbytes, 1, ISO_BUFFERS_SIZE - rbytes, ttainfo->HANDLE); if (!res) { ttainfo->STATE = READ_ERROR; @@ -260,7 +260,7 @@ } __ATTRIBUTE_PACKED__ id3v2; unsigned int len = 0; - if (!fread(&id3v2, sizeof(id3v2), 1, ttainfo->HANDLE) || + if (!vfs_fread(&id3v2, sizeof(id3v2), 1, ttainfo->HANDLE) || memcmp(id3v2.id, "ID3", 3) || id3v2.size[0] & 0x80) { @@ -279,14 +279,14 @@ } int open_tta_file (const char *filename, tta_info *info, unsigned int data_offset) { - FILE *infile; + VFSFile *infile; tta_hdr ttahdr; unsigned int checksum; // clear the memory memset (info, 0, sizeof(tta_info)); - info->HANDLE = infile = fopen(filename, "rb"); + info->HANDLE = infile = vfs_fopen(filename, "rb"); if (!infile) return OPEN_ERROR; // read id3v2 header @@ -294,18 +294,18 @@ // data_offset = id3v2_header_length(info); data_offset = get_id3_tags (filename, info); - fseek (infile, data_offset, SEEK_SET); + vfs_fseek (infile, data_offset, SEEK_SET); // read TTA header - if (fread (&ttahdr, 1, sizeof (ttahdr), infile) == 0) { - fclose (infile); + if (vfs_fread (&ttahdr, 1, sizeof (ttahdr), infile) == 0) { + vfs_fclose (infile); info->STATE = READ_ERROR; return -1; } // check for TTA3 signature if (ENDSWAP_INT32(ttahdr.TTAid) != TTA1_SIGN) { - fclose (infile); + vfs_fclose (infile); info->STATE = FORMAT_ERROR; return -1; } @@ -314,7 +314,7 @@ checksum = crc32((unsigned char *) &ttahdr, sizeof(tta_hdr) - sizeof(int)); if (checksum != ttahdr.CRC32) { - fclose (infile); + vfs_fclose (infile); info->STATE = FILE_ERROR; return -1; } @@ -338,7 +338,7 @@ ttahdr.SampleRate != 64000 && ttahdr.SampleRate != 88200 && ttahdr.SampleRate != 96000)) { - fclose (infile); + vfs_fclose (infile); info->STATE = FORMAT_ERROR; return FORMAT_ERROR; } @@ -398,7 +398,7 @@ } seek_pos = ttainfo->DATAPOS + seek_table[data_pos = pos]; - fseek(ttainfo->HANDLE, seek_pos, SEEK_SET); + vfs_fseek(ttainfo->HANDLE, seek_pos, SEEK_SET); data_cur = 0; framelen = 0; @@ -432,7 +432,7 @@ } // read seek table - if (!fread(seek_table, st_size, 1, ttainfo->HANDLE)) { + if (!vfs_fread(seek_table, st_size, 1, ttainfo->HANDLE)) { ttainfo->STATE = READ_ERROR; return -1; } @@ -455,7 +455,7 @@ void close_tta_file (tta_info *info) { if (info->HANDLE) { - fclose (info->HANDLE); + vfs_fclose (info->HANDLE); info->HANDLE = NULL; } } @@ -530,8 +530,7 @@ rice->k0++; } - // DEC is not defined?? -// value = DEC(value); + value = DEC(value); // decompress stage 1: adaptive hybrid filter hybrid_filter(fst, &value);
--- a/src/tta/ttalib.h Wed Jul 11 07:55:13 2007 -0500 +++ b/src/tta/ttalib.h Thu Jul 12 04:36:03 2007 +0900 @@ -80,7 +80,7 @@ } id3_info; typedef struct { - FILE *HANDLE; // file handle + VFSFile *HANDLE; // file handle unsigned short NCH; // number of channels unsigned short BPS; // bits per sample unsigned short BSIZE; // byte size