winemp3: Replace fprintf with wine debugging facilities.

This commit is contained in:
Maarten Lankhorst 2008-03-31 11:19:58 -07:00 committed by Alexandre Julliard
parent 01d167be7c
commit 0faee4af85
3 changed files with 25 additions and 18 deletions

View File

@ -28,6 +28,9 @@
#include <fcntl.h>
#include "mpg123.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mpeg3);
const struct parameter param = { 1 , 1 , 0 , 0 };
@ -109,7 +112,7 @@ int decode_header(struct frame *fr,unsigned long newhead)
if(!fr->bitrate_index)
{
fprintf(stderr,"Free format not supported.\n");
FIXME("Free format not supported.\n");
return (0);
}
@ -125,7 +128,7 @@ int decode_header(struct frame *fr,unsigned long newhead)
fr->framesize /= freqs[fr->sampling_frequency];
fr->framesize = ((fr->framesize+fr->padding)<<2)-4;
#else
fprintf(stderr,"Not supported!\n");
FIXME("Layer 1 not supported!\n");
#endif
break;
case 2:
@ -138,7 +141,7 @@ int decode_header(struct frame *fr,unsigned long newhead)
fr->framesize /= freqs[fr->sampling_frequency];
fr->framesize += fr->padding - 4;
#else
fprintf(stderr,"Not supported!\n");
FIXME("Layer 2 not supported!\n");
#endif
break;
case 3:
@ -159,7 +162,7 @@ int decode_header(struct frame *fr,unsigned long newhead)
fr->framesize = fr->framesize + fr->padding - 4;
break;
default:
fprintf(stderr,"Sorry, unknown layer type.\n");
FIXME("Unknown layer type: %d\n", fr->lay);
return (0);
}
return 1;
@ -171,15 +174,15 @@ void print_header(struct frame *fr)
static const char * const modes[4] = { "Stereo", "Joint-Stereo", "Dual-Channel", "Single-Channel" };
static const char * const layers[4] = { "Unknown" , "I", "II", "III" };
fprintf(stderr,"MPEG %s, Layer: %s, Freq: %ld, mode: %s, modext: %d, BPF : %d\n",
FIXME("MPEG %s, Layer: %s, Freq: %ld, mode: %s, modext: %d, BPF : %d\n",
fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
layers[fr->lay],freqs[fr->sampling_frequency],
modes[fr->mode],fr->mode_ext,fr->framesize+4);
fprintf(stderr,"Channels: %d, copyright: %s, original: %s, CRC: %s, emphasis: %d.\n",
FIXME("Channels: %d, copyright: %s, original: %s, CRC: %s, emphasis: %d.\n",
fr->stereo,fr->copyright?"Yes":"No",
fr->original?"Yes":"No",fr->error_protection?"Yes":"No",
fr->emphasis);
fprintf(stderr,"Bitrate: %d Kbits/s, Extension value: %d\n",
FIXME("Bitrate: %d Kbits/s, Extension value: %d\n",
tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index],fr->extension);
}
@ -188,7 +191,7 @@ void print_header_compact(struct frame *fr)
static const char * const modes[4] = { "stereo", "joint-stereo", "dual-channel", "mono" };
static const char * const layers[4] = { "Unknown" , "I", "II", "III" };
fprintf(stderr,"MPEG %s layer %s, %d kbit/s, %ld Hz %s\n",
FIXME("MPEG %s layer %s, %d kbit/s, %ld Hz %s\n",
fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
layers[fr->lay],
tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index],

View File

@ -16,9 +16,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include "wine/debug.h"
#include "mpg123.h"
#include "mpglib.h"

View File

@ -20,13 +20,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include "wine/debug.h"
#include "mpg123.h"
#include "mpglib.h"
#include "huffman.h"
#define MPEG1
WINE_DEFAULT_DEBUG_CHANNEL(mpeg3);
static real ispow[8207];
static real aa_ca[8],aa_cs[8];
@ -333,7 +335,7 @@ static int III_get_side_info_1(struct III_sideinfo *si,int stereo,
gr_info->part2_3_length = getbits(12);
gr_info->big_values = getbits_fast(9);
if(gr_info->big_values > 288) {
fprintf(stderr,"big_values too large!\n");
FIXME("big_values (%d) too large!\n", gr_info->big_values);
gr_info->big_values = 288;
}
gr_info->pow2gain = gainpow2+256 - getbits_fast(8) + powdiff;
@ -357,7 +359,7 @@ static int III_get_side_info_1(struct III_sideinfo *si,int stereo,
gr_info->full_gain[i] = gr_info->pow2gain + (getbits_fast(3)<<3);
if(gr_info->block_type == 0) {
fprintf(stderr,"Blocktype == 0 and window-switching == 1 not allowed.\n");
FIXME("Blocktype == 0 and window-switching == 1 not allowed.\n");
return 0;
}
/* region_count/start parameters are implicit in this case. */
@ -407,7 +409,7 @@ static int III_get_side_info_2(struct III_sideinfo *si,int stereo,
gr_info->part2_3_length = getbits(12);
gr_info->big_values = getbits_fast(9);
if(gr_info->big_values > 288) {
fprintf(stderr,"big_values too large!\n");
FIXME("big_values(%d) too large!\n", gr_info->big_values);
gr_info->big_values = 288;
}
gr_info->pow2gain = gainpow2+256 - getbits_fast(8) + powdiff;
@ -431,7 +433,7 @@ static int III_get_side_info_2(struct III_sideinfo *si,int stereo,
gr_info->full_gain[i] = gr_info->pow2gain + (getbits_fast(3)<<3);
if(gr_info->block_type == 0) {
fprintf(stderr,"Blocktype == 0 and window-switching == 1 not allowed.\n");
FIXME("Blocktype == 0 and window-switching == 1 not allowed.\n");
return 0;
}
/* region_count/start parameters are implicit in this case. */
@ -968,7 +970,7 @@ static int III_dequantize_sample(real xr[SBLIMIT][SSLIMIT],int *scf,
if(part2remain > 0)
getbits(part2remain);
else if(part2remain < 0) {
fprintf(stderr,"mpg123: Can't rewind stream by %d bits!\n",-part2remain);
FIXME("mpg123: Can't rewind stream by %d bits!\n",-part2remain);
return 1; /* -> error */
}
return 0;
@ -1379,7 +1381,7 @@ static int III_dequantize_sample_ms(real xr[2][SBLIMIT][SSLIMIT],int *scf,
if(part2remain > 0 )
getbits(part2remain);
else if(part2remain < 0) {
fprintf(stderr,"mpg123_ms: Can't rewind stream by %d bits!\n",-part2remain);
FIXME("mpg123_ms: Can't rewind stream by %d bits!\n",-part2remain);
return 1; /* -> error */
}
return 0;
@ -1917,7 +1919,7 @@ int do_layer3(struct frame *fr,unsigned char *pcm_sample,int *pcm_point)
if(!III_get_side_info_1(&sideinfo,stereo,ms_stereo,sfreq,single))
return -1;
#else
fprintf(stderr,"Not supported\n");
FIXME("Not supported\n");
#endif
}
@ -1938,7 +1940,7 @@ int do_layer3(struct frame *fr,unsigned char *pcm_sample,int *pcm_point)
#ifdef MPEG1
part2bits = III_get_scale_factors_1(scalefacs[0],gr_info);
#else
fprintf(stderr,"Not supported\n");
FIXME("Not supported\n");
#endif
}
if(III_dequantize_sample(hybridIn[0], scalefacs[0],gr_info,sfreq,part2bits))
@ -1953,7 +1955,7 @@ int do_layer3(struct frame *fr,unsigned char *pcm_sample,int *pcm_point)
#ifdef MPEG1
part2bits = III_get_scale_factors_1(scalefacs[1],gr_info);
#else
fprintf(stderr,"Not supported\n");
FIXME("Not supported\n");
#endif
}