Menu

#9 Patch for 0.2j release (differents problems)

open
nobody
None
5
2003-02-14
2003-02-14
No

Some comments :
audio_read.c :
To suppress the limit of 4GB when we open a stream from
/dev/dsp for example.
------------------------
bitstream.c :
Sometimes we have one byte more a the end of an .mp2
file. So now it's possible concatenate MP2 file with
multiple MP2 files.
------------------------
common.h :
toolame.c :

It's possible to define the size of X-PAD (DAB option).
------------------------
psycho_I.c :
This modification had been made because in some
circunstances we had a core dump.

diff -u toolame-02j.orig/audio_read.c
toolame-02j/audio_read.c
--- toolame-02j.orig/audio_read.c Thu Feb 13 11:41:04 2003
+++ toolame-02j/audio_read.c Fri Feb 14 18:25:01 2003
@@ -53,12 +53,14 @@
if (NativeByteOrder != order_littleEndian ||
(glopts.byteswap == TRUE))
SwapBytesInWords (sample_buffer, samples_read);
- samples_to_read -= samples_read;
+ if (num_samples != MAX_U_32_NUM)
+ samples_to_read -= samples_read;
if (samples_read < frame_size && samples_read > 0)
{
- fprintf (stderr, "Insufficient PCM input for one
frame - fillout with zeros\n");
+// fprintf (stderr, "Insufficient PCM input for one
frame - fillout with zeros\n");
for (; samples_read < frame_size;
sample_buffer[samples_read++] = 0);
samples_to_read = 0;
+ samples_read = frame_size ;
}
return (samples_read);
}
@@ -269,7 +271,7 @@
int wave_header_read = 0;
int wave_header_stereo = -1;
int wave_header_16bit = -1;
- long samplerate;
+ unsigned long samplerate;
/*************************** STDIN
********************************/
/* check if we're reading from stdin. Assume it's a raw
PCM file. */
diff -u toolame-02j.orig/bitstream.c
toolame-02j/bitstream.c
--- toolame-02j.orig/bitstream.c Thu Feb 13 11:46:57 2003
+++ toolame-02j/bitstream.c Fri Feb 14 17:11:44 2003
@@ -144,7 +144,8 @@
/*close the device containing the bit stream after a
write process*/
void close_bit_stream_w (Bit_stream_struc * bs)
{
- empty_buffer (bs, bs->buf_byte_idx);
+ putbits (bs, 0, 7);
+ empty_buffer (bs, bs->buf_byte_idx+1);
fclose (bs->pt);
desalloc_buffer (bs);
}
diff -u toolame-02j.orig/common.h toolame-02j/common.h
--- toolame-02j.orig/common.h Wed Feb 12 08:50:30 2003
+++ toolame-02j/common.h Fri Feb 14 18:10:45 2003
@@ -107,6 +107,7 @@
int lay;
int error_protection;
int dab_extension;
+ int dab_length;
int bitrate_index;
int sampling_frequency;
int padding;
Common subdirectories: toolame-02j.orig/html and
toolame-02j/html
diff -u toolame-02j.orig/psycho_I.c toolame-02j/psycho_I.c
--- toolame-02j.orig/psycho_I.c Thu Feb 13 09:56:28 2003
+++ toolame-02j/psycho_I.c Fri Feb 14 17:22:29 2003
@@ -546,7 +546,8 @@
/* fix for LSF segfault? */
while (i > LAST)
#else
- while (i != LAST)
+ // while (i != LAST)
+ while ((i != LAST) && (i != STOP))
#endif
{ /* reduction of spectral lines */
if (power[i].x < ltg[power[i].map].hear)
@@ -564,7 +565,8 @@
}
i = *noise;
old = STOP; /* calculate non-tonal components for */
- while (i != LAST)
+ // while (i != LAST)
+ while ((i != LAST) && (i != STOP))
{ /* reduction of spectral lines */
if (power[i].x < ltg[power[i].map].hear)
{
@@ -585,7 +587,8 @@
/* FIXME: why is i undef'd for some of LSF ? */
while (i > LAST)
#else
- while (i != LAST)
+ // while (i != LAST)
+ while ((i != LAST) && (i != STOP))
#endif
{ /* if more than one */
if (power[i].next == LAST)
Common subdirectories: toolame-02j.orig/text and
toolame-02j/text
diff -u toolame-02j.orig/toolame.c toolame-02j/toolame.c
--- toolame-02j.orig/toolame.c Thu Feb 13 11:47:51 2003
+++ toolame-02j/toolame.c Fri Feb 14 18:47:41 2003
@@ -189,7 +189,7 @@
/* see bitstream.c */
if (frameNum == 1)
minimum = lg_frame + MINIMUM;
- adb -= info.dab_extension * 8 + 6 * 8;
+ adb -= info.dab_extension * 8 + info.dab_length * 8 +
16;
}
for (i = 0; i < 3; i++)
@@ -274,7 +274,7 @@
if (info.dab_extension)
{
/* reserved 4 bytes for X-PAD in DAB mode */
- putbits (&bs, 0, 32);
+ putbits (&bs, 0, info.dab_length*8);
for (i = info.dab_extension - 1; i >= 0; i--)
{
CRC_calcDAB (&fr_ps, bit_alloc, scfsi, scalar, &crc, i);
@@ -404,7 +404,7 @@
fprintf (stdout, "\t-o mark as original\n");
fprintf (stdout, "\t-e add error protection\n");
fprintf (stdout, "\t-r force padding bit/frame off\n");
- fprintf (stdout, "\t-D add DAB extensions\n");
+ fprintf (stdout, "\t-D len add DAB extensions\n");
fprintf (stdout, "\t-t talkativity 0=no messages (dflt
2)");
fprintf (stdout, "Files\n");
fprintf (stdout, "\tinput input sound file.
(WAV,AIFF,PCM or use '/dev/stdin')\n");
@@ -632,6 +632,9 @@
}
break;
case 'D':
+ argUsed = 1;
+ info->dab_length = atoi (arg);
+ info->error_protection = TRUE;
info->dab_extension = 2;
glopts.dab = TRUE;
break;

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.