Commit 0faee4af authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

winemp3: Replace fprintf with wine debugging facilities.

parent 01d167be
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
#include <fcntl.h> #include <fcntl.h>
#include "mpg123.h" #include "mpg123.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mpeg3);
const struct parameter param = { 1 , 1 , 0 , 0 }; const struct parameter param = { 1 , 1 , 0 , 0 };
...@@ -109,7 +112,7 @@ int decode_header(struct frame *fr,unsigned long newhead) ...@@ -109,7 +112,7 @@ int decode_header(struct frame *fr,unsigned long newhead)
if(!fr->bitrate_index) if(!fr->bitrate_index)
{ {
fprintf(stderr,"Free format not supported.\n"); FIXME("Free format not supported.\n");
return (0); return (0);
} }
...@@ -125,7 +128,7 @@ int decode_header(struct frame *fr,unsigned long newhead) ...@@ -125,7 +128,7 @@ int decode_header(struct frame *fr,unsigned long newhead)
fr->framesize /= freqs[fr->sampling_frequency]; fr->framesize /= freqs[fr->sampling_frequency];
fr->framesize = ((fr->framesize+fr->padding)<<2)-4; fr->framesize = ((fr->framesize+fr->padding)<<2)-4;
#else #else
fprintf(stderr,"Not supported!\n"); FIXME("Layer 1 not supported!\n");
#endif #endif
break; break;
case 2: case 2:
...@@ -138,7 +141,7 @@ int decode_header(struct frame *fr,unsigned long newhead) ...@@ -138,7 +141,7 @@ int decode_header(struct frame *fr,unsigned long newhead)
fr->framesize /= freqs[fr->sampling_frequency]; fr->framesize /= freqs[fr->sampling_frequency];
fr->framesize += fr->padding - 4; fr->framesize += fr->padding - 4;
#else #else
fprintf(stderr,"Not supported!\n"); FIXME("Layer 2 not supported!\n");
#endif #endif
break; break;
case 3: case 3:
...@@ -159,7 +162,7 @@ int decode_header(struct frame *fr,unsigned long newhead) ...@@ -159,7 +162,7 @@ int decode_header(struct frame *fr,unsigned long newhead)
fr->framesize = fr->framesize + fr->padding - 4; fr->framesize = fr->framesize + fr->padding - 4;
break; break;
default: default:
fprintf(stderr,"Sorry, unknown layer type.\n"); FIXME("Unknown layer type: %d\n", fr->lay);
return (0); return (0);
} }
return 1; return 1;
...@@ -171,15 +174,15 @@ void print_header(struct frame *fr) ...@@ -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 modes[4] = { "Stereo", "Joint-Stereo", "Dual-Channel", "Single-Channel" };
static const char * const layers[4] = { "Unknown" , "I", "II", "III" }; 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"), fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
layers[fr->lay],freqs[fr->sampling_frequency], layers[fr->lay],freqs[fr->sampling_frequency],
modes[fr->mode],fr->mode_ext,fr->framesize+4); 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->stereo,fr->copyright?"Yes":"No",
fr->original?"Yes":"No",fr->error_protection?"Yes":"No", fr->original?"Yes":"No",fr->error_protection?"Yes":"No",
fr->emphasis); 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); tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index],fr->extension);
} }
...@@ -188,7 +191,7 @@ void print_header_compact(struct frame *fr) ...@@ -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 modes[4] = { "stereo", "joint-stereo", "dual-channel", "mono" };
static const char * const layers[4] = { "Unknown" , "I", "II", "III" }; 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"), fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
layers[fr->lay], layers[fr->lay],
tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index], tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index],
......
...@@ -16,9 +16,11 @@ ...@@ -16,9 +16,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include "wine/debug.h"
#include "mpg123.h" #include "mpg123.h"
#include "mpglib.h" #include "mpglib.h"
......
...@@ -20,13 +20,15 @@ ...@@ -20,13 +20,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include "wine/debug.h"
#include "mpg123.h" #include "mpg123.h"
#include "mpglib.h" #include "mpglib.h"
#include "huffman.h" #include "huffman.h"
#define MPEG1 #define MPEG1
WINE_DEFAULT_DEBUG_CHANNEL(mpeg3);
static real ispow[8207]; static real ispow[8207];
static real aa_ca[8],aa_cs[8]; 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, ...@@ -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->part2_3_length = getbits(12);
gr_info->big_values = getbits_fast(9); gr_info->big_values = getbits_fast(9);
if(gr_info->big_values > 288) { 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->big_values = 288;
} }
gr_info->pow2gain = gainpow2+256 - getbits_fast(8) + powdiff; 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, ...@@ -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); gr_info->full_gain[i] = gr_info->pow2gain + (getbits_fast(3)<<3);
if(gr_info->block_type == 0) { 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; return 0;
} }
/* region_count/start parameters are implicit in this case. */ /* 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, ...@@ -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->part2_3_length = getbits(12);
gr_info->big_values = getbits_fast(9); gr_info->big_values = getbits_fast(9);
if(gr_info->big_values > 288) { 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->big_values = 288;
} }
gr_info->pow2gain = gainpow2+256 - getbits_fast(8) + powdiff; 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, ...@@ -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); gr_info->full_gain[i] = gr_info->pow2gain + (getbits_fast(3)<<3);
if(gr_info->block_type == 0) { 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; return 0;
} }
/* region_count/start parameters are implicit in this case. */ /* region_count/start parameters are implicit in this case. */
...@@ -968,7 +970,7 @@ static int III_dequantize_sample(real xr[SBLIMIT][SSLIMIT],int *scf, ...@@ -968,7 +970,7 @@ static int III_dequantize_sample(real xr[SBLIMIT][SSLIMIT],int *scf,
if(part2remain > 0) if(part2remain > 0)
getbits(part2remain); getbits(part2remain);
else if(part2remain < 0) { 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 1; /* -> error */
} }
return 0; return 0;
...@@ -1379,7 +1381,7 @@ static int III_dequantize_sample_ms(real xr[2][SBLIMIT][SSLIMIT],int *scf, ...@@ -1379,7 +1381,7 @@ static int III_dequantize_sample_ms(real xr[2][SBLIMIT][SSLIMIT],int *scf,
if(part2remain > 0 ) if(part2remain > 0 )
getbits(part2remain); getbits(part2remain);
else if(part2remain < 0) { 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 1; /* -> error */
} }
return 0; return 0;
...@@ -1917,7 +1919,7 @@ int do_layer3(struct frame *fr,unsigned char *pcm_sample,int *pcm_point) ...@@ -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)) if(!III_get_side_info_1(&sideinfo,stereo,ms_stereo,sfreq,single))
return -1; return -1;
#else #else
fprintf(stderr,"Not supported\n"); FIXME("Not supported\n");
#endif #endif
} }
...@@ -1938,7 +1940,7 @@ int do_layer3(struct frame *fr,unsigned char *pcm_sample,int *pcm_point) ...@@ -1938,7 +1940,7 @@ int do_layer3(struct frame *fr,unsigned char *pcm_sample,int *pcm_point)
#ifdef MPEG1 #ifdef MPEG1
part2bits = III_get_scale_factors_1(scalefacs[0],gr_info); part2bits = III_get_scale_factors_1(scalefacs[0],gr_info);
#else #else
fprintf(stderr,"Not supported\n"); FIXME("Not supported\n");
#endif #endif
} }
if(III_dequantize_sample(hybridIn[0], scalefacs[0],gr_info,sfreq,part2bits)) 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) ...@@ -1953,7 +1955,7 @@ int do_layer3(struct frame *fr,unsigned char *pcm_sample,int *pcm_point)
#ifdef MPEG1 #ifdef MPEG1
part2bits = III_get_scale_factors_1(scalefacs[1],gr_info); part2bits = III_get_scale_factors_1(scalefacs[1],gr_info);
#else #else
fprintf(stderr,"Not supported\n"); FIXME("Not supported\n");
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment