1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 23:32:26 +00:00

printfs cleanup - moved to higher -v level or moved to stderr

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1457 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2001-08-06 23:59:50 +00:00
parent bed9711530
commit 2e5a0ca6fe
8 changed files with 42 additions and 24 deletions

View File

@ -24,6 +24,7 @@ extern int verbose; // defined in mplayer.c
static MainAVIHeader avih;
extern void print_avih(MainAVIHeader *h);
extern void print_avih_flags(MainAVIHeader *h);
extern void print_strh(AVIStreamHeader *h);
extern void print_wave_header(WAVEFORMATEX *h);
extern void print_index(AVIINDEXENTRY *idx,int idx_size);
@ -67,7 +68,7 @@ while(1){
stream_read(demuxer->stream,(char*) &avih,MIN(size2,sizeof(avih)));
le2me_MainAVIHeader(&avih); // swap to machine endian
chunksize-=MIN(size2,sizeof(avih));
if(verbose) print_avih(&avih);
if(verbose) print_avih(&avih); else print_avih_flags(&avih);
break;
case ckidSTREAMHEADER: { // read 'strh'
AVIStreamHeader h;

View File

@ -15,13 +15,8 @@
//#include "codec-cfg.h"
//#include "stheader.h"
void print_avih(MainAVIHeader *h){
printf("======= AVI Header =======\n");
printf("us/frame: %ld (fps=%5.3f)\n",h->dwMicroSecPerFrame,1000000.0f/(float)h->dwMicroSecPerFrame);
printf("max bytes/sec: %ld\n",h->dwMaxBytesPerSec);
printf("padding: %ld\n",h->dwPaddingGranularity);
printf("flags: (%ld)%s%s%s%s%s%s\n",h->dwFlags,
void print_avih_flags(MainAVIHeader *h){
printf("MainAVIHeader.dwFlags: (%ld)%s%s%s%s%s%s\n",h->dwFlags,
(h->dwFlags&AVIF_HASINDEX)?" HAS_INDEX":"",
(h->dwFlags&AVIF_MUSTUSEINDEX)?" MUST_USE_INDEX":"",
(h->dwFlags&AVIF_ISINTERLEAVED)?" IS_INTERLEAVED":"",
@ -29,6 +24,14 @@ void print_avih(MainAVIHeader *h){
(h->dwFlags&AVIF_WASCAPTUREFILE)?" WAS_CAPTUREFILE":"",
(h->dwFlags&AVIF_COPYRIGHTED)?" COPYRIGHTED":""
);
}
void print_avih(MainAVIHeader *h){
printf("======= AVI Header =======\n");
printf("us/frame: %ld (fps=%5.3f)\n",h->dwMicroSecPerFrame,1000000.0f/(float)h->dwMicroSecPerFrame);
printf("max bytes/sec: %ld\n",h->dwMaxBytesPerSec);
printf("padding: %ld\n",h->dwPaddingGranularity);
print_avih_flags(h);
printf("frames total: %ld initial: %ld\n",h->dwTotalFrames,h->dwInitialFrames);
printf("streams: %ld\n",h->dwStreams);
printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize);

View File

@ -145,12 +145,12 @@ if(!driver) return 0;
// allocate audio out buffer:
sh_audio->a_buffer_size=sh_audio->audio_out_minsize+MAX_OUTBURST; // worst case calc.
printf("dec_audio: Allocating %d + %d = %d bytes for output buffer\n",
if(verbose) printf("dec_audio: Allocating %d + %d = %d bytes for output buffer\n",
sh_audio->audio_out_minsize,MAX_OUTBURST,sh_audio->a_buffer_size);
sh_audio->a_buffer=malloc(sh_audio->a_buffer_size);
if(!sh_audio->a_buffer){
printf("Cannot allocate audio out buffer\n");
fprintf(stderr,"Cannot allocate audio out buffer\n");
return 0;
}
memset(sh_audio->a_buffer,0,sh_audio->a_buffer_size);

View File

@ -64,7 +64,7 @@ sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id){
if(demuxer->a_streams[id]){
printf("Warning! Audio stream header %d redefined!\n",id);
} else {
printf("==> Found audio stream: %d\n",id);
if(verbose) printf("==> Found audio stream: %d\n",id);
demuxer->a_streams[id]=malloc(sizeof(sh_audio_t));
memset(demuxer->a_streams[id],0,sizeof(sh_audio_t));
}
@ -75,7 +75,7 @@ sh_video_t* new_sh_video(demuxer_t *demuxer,int id){
if(demuxer->v_streams[id]){
printf("Warning! video stream header %d redefined!\n",id);
} else {
printf("==> Found video stream: %d\n",id);
if(verbose) printf("==> Found video stream: %d\n",id);
demuxer->v_streams[id]=malloc(sizeof(sh_video_t));
memset(demuxer->v_streams[id],0,sizeof(sh_video_t));
}

View File

@ -102,8 +102,8 @@ static int control(int cmd,int arg){
// return: 1=success 0=fail
static int init(int rate,int channels,int format,int flags){
printf("ao2: %d Hz %d chans %s\n",rate,channels,
audio_out_format_name(format));
// printf("ao2: %d Hz %d chans %s\n",rate,channels,
// audio_out_format_name(format));
if (ao_subdevice)
dsp = ao_subdevice;

View File

@ -238,8 +238,8 @@ static int init(int rate,int channels,int format,int flags){
enable_sample_timing = realtime_samplecounter_available(audio_dev);
}
printf("ao2: %d Hz %d chans %s [0x%X]\n",
rate,channels,audio_out_format_name(format),format);
// printf("ao2: %d Hz %d chans %s [0x%X]\n",
// rate,channels,audio_out_format_name(format),format);
audio_fd=open(audio_dev, O_WRONLY);
if(audio_fd<0){

View File

@ -21,6 +21,8 @@
#include <X11/extensions/dpms.h>
#endif
extern verbose;
static int dpms_disabled=0;
static int timeout_save=0;
@ -83,6 +85,7 @@ int vo_init( void )
bpp=mXImage->bits_per_pixel;
if((vo_depthonscreen+7)/8 != (bpp+7)/8) vo_depthonscreen=bpp; // by A'rpi
mask=mXImage->red_mask|mXImage->green_mask|mXImage->blue_mask;
if(verbose)
printf("vo: X11 color mask: %X (R:%lX G:%lX B:%lX)\n",
mask,mXImage->red_mask,mXImage->green_mask,mXImage->blue_mask);
if(((vo_depthonscreen+7)/8)==2){

View File

@ -677,6 +677,7 @@ if(vcd_track){
if (len == -1)
perror("Error: lseek failed to obtain video file size");
else
if(verbose)
#ifdef _LARGEFILE_SOURCE
printf("File size is %lld bytes\n", (long long)len);
#else
@ -979,6 +980,7 @@ make_pipe(&keyb_fifo_get,&keyb_fifo_put);
(flip==1)?"flip ":""
// fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3)
);
if(verbose){
printf("VO: Description: %s\n"
"VO: Author: %s\n",
info->name,
@ -986,6 +988,7 @@ make_pipe(&keyb_fifo_get,&keyb_fifo_put);
);
if(strlen(info->comment) > 0)
printf("VO: Comment: %s\n", info->comment);
}
}
#endif
@ -1088,19 +1091,20 @@ double vdecode_time;
if(sh_audio){
const ao_info_t *info=audio_out->info;
printf("AO: [%s] %iHz %s %s\n"
"AO: Description: %s\n"
"AO: Author: %s\n",
printf("AO: [%s] %iHz %s %s\n",
info->short_name,
force_srate?force_srate:sh_audio->samplerate,
sh_audio->channels>1?"Stereo":"Mono",
audio_out_format_name(sh_audio->sample_format),
audio_out_format_name(sh_audio->sample_format)
);
if(verbose){
printf("AO: Description: %s\nAO: Author: %s\n",
info->name,
info->author
);
if(strlen(info->comment) > 0)
if(strlen(info->comment) > 0)
printf("AO: Comment: %s\n", info->comment);
}
if(!audio_out->init(force_srate?force_srate:sh_audio->samplerate,
sh_audio->channels,sh_audio->sample_format,0)){
printf("couldn't open/init audio device -> NOSOUND\n");
@ -1371,6 +1375,11 @@ if(1)
if(time_frame<-2*frame_time){
drop_frame=frame_dropping; // tricky!
++drop_frame_cnt;
if(drop_frame_cnt==50 && frame_dropping<1)
printf("\n************************************************************************"
"\n** Your system is too SLOW to play this! try with -framedrop or RTFM! **"
"\n************************************************************************"
"\n");
if (verbose>0) printf("\nframe drop %d, %.2f\n", drop_frame, time_frame);
}
} else {
@ -1434,9 +1443,10 @@ if(1)
if(verbose)printf("%5.3f|",v_pts-d_video->pts);
} else {
if(!delay_corrected && d_audio->pts){
// float x=d_audio->pts-d_video->pts-(delay);
float x=d_audio->pts-d_video->pts-(delay+audio_delay);
float y=-(delay+audio_delay);
printf("Initial PTS delay: %5.3f sec (calculated: %5.3f)\n",x,y);
printf("Initial PTS delay: %5.3f sec (calculated: %5.3f) audio_delay=%5.3f\n",x,y,audio_delay);
initial_pts_delay+=x;
audio_delay+=x;
delay_corrected=1;
@ -1447,7 +1457,8 @@ if(1)
// PTS = (last timestamp) + (bytes after last timestamp)/(bytes per sec)
a_pts=d_audio->pts;
a_pts+=(ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
v_pts=d_video->pts-frame_time;
// v_pts=d_video->pts-frame_time;
v_pts=d_video->pts;
}
if(verbose>1)printf("### A:%8.3f (%8.3f) V:%8.3f A-V:%7.4f \n",a_pts,a_pts-audio_delay-delay,v_pts,(a_pts-delay-audio_delay)-v_pts);