[Mplayer-cvslog] CVS: main aviheader.c,1.19,1.20 aviprint.c,1.5,1.6 dec_audio.c,1.26,1.27 demuxer.c,1.16,1.17 mplayer.c,1.203,1.204
Arpi of Ize
arpi at mplayer.dev.hu
Tue Aug 7 01:59:52 CEST 2001
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv14040
Modified Files:
aviheader.c aviprint.c dec_audio.c demuxer.c mplayer.c
Log Message:
printfs cleanup - moved to higher -v level or moved to stderr
Index: aviheader.c
===================================================================
RCS file: /cvsroot/mplayer/main/aviheader.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- aviheader.c 1 Aug 2001 09:14:02 -0000 1.19
+++ aviheader.c 6 Aug 2001 23:59:49 -0000 1.20
@@ -24,6 +24,7 @@
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 @@
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;
Index: aviprint.c
===================================================================
RCS file: /cvsroot/mplayer/main/aviprint.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- aviprint.c 1 Aug 2001 09:14:02 -0000 1.5
+++ aviprint.c 6 Aug 2001 23:59:49 -0000 1.6
@@ -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 @@
(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);
Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_audio.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- dec_audio.c 1 Aug 2001 09:14:02 -0000 1.26
+++ dec_audio.c 6 Aug 2001 23:59:49 -0000 1.27
@@ -145,12 +145,12 @@
// 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);
Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/demuxer.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- demuxer.c 1 Aug 2001 09:14:02 -0000 1.16
+++ demuxer.c 6 Aug 2001 23:59:49 -0000 1.17
@@ -64,7 +64,7 @@
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 @@
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));
}
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -r1.203 -r1.204
--- mplayer.c 6 Aug 2001 00:33:30 -0000 1.203
+++ mplayer.c 6 Aug 2001 23:59:49 -0000 1.204
@@ -677,6 +677,7 @@
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 @@
(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 @@
);
if(strlen(info->comment) > 0)
printf("VO: Comment: %s\n", info->comment);
+ }
}
#endif
@@ -1088,19 +1091,20 @@
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(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(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 @@
// 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);
More information about the MPlayer-cvslog
mailing list