changeset 340:1f7c824033fb

less, and more informal printfs
author arpi_esp
date Wed, 11 Apr 2001 01:38:57 +0000
parents e7e89cd4169f
children ac58837db8ad
files asfheader.c dec_audio.c help_avp.h help_mp.h libvo/font_load.c libvo/vo_xmga.c loader/driver.c loader/dshow/DS_Filter.c loader/registry.c loader/setup_FS.c loader/win32.c mplayer.c
diffstat 12 files changed, 62 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/asfheader.c	Wed Apr 11 00:47:05 2001 +0000
+++ b/asfheader.c	Wed Apr 11 01:38:57 2001 +0000
@@ -105,7 +105,7 @@
   unsigned char buffer[512];
   
 #if 1
-  printf("ASF file! (subchunks: %d)\n",asfh.cno);
+  //printf("ASF file! (subchunks: %d)\n",asfh.cno);
 while(!stream_eof(demuxer->stream)){
   int pos,endpos;
   pos=stream_tell(demuxer->stream);
@@ -113,15 +113,17 @@
   if(stream_eof(demuxer->stream)) break; // EOF
   endpos=pos+objh.size;
 //  for(i=0;i<16;i++) printf("%02X ",objh.guid[i]);
-  printf("0x%08X  [%s] %d\n",pos, asf_chunk_type(objh.guid),(int) objh.size);
+  //printf("0x%08X  [%s] %d\n",pos, asf_chunk_type(objh.guid),(int) objh.size);
   switch(*((unsigned int*)&objh.guid)){
     case 0xB7DC0791: // guid_stream_header
       stream_read(demuxer->stream,(char*) &streamh,sizeof(streamh));
+if(verbose){
       printf("stream type: %s\n",asf_chunk_type(streamh.type));
       printf("stream concealment: %s\n",asf_chunk_type(streamh.concealment));
       printf("type: %d bytes,  stream: %d bytes  ID: %d\n",(int)streamh.type_size,(int)streamh.stream_size,(int)streamh.stream_no);
       printf("unk1: %lX  unk2: %X\n",streamh.unk1,streamh.unk2);
       printf("FILEPOS=0x%X\n",stream_tell(demuxer->stream));
+}
       // type-specific data:
       stream_read(demuxer->stream,(char*) buffer,streamh.type_size);
       switch(*((unsigned int*)&streamh.type)){
@@ -138,7 +140,7 @@
 	} else {
 	  asf_scrambling_b=asf_scrambling_h=asf_scrambling_w=1;
 	}
-	printf("ASF audio scrambling: %d x %d x %d\n",asf_scrambling_h,asf_scrambling_w,asf_scrambling_b);
+	printf("ASF: audio scrambling: %d x %d x %d\n",asf_scrambling_h,asf_scrambling_w,asf_scrambling_b);
 	if(demuxer->audio->id==-1) demuxer->audio->id=streamh.stream_no & 0x7F;
         break;
         }
@@ -159,7 +161,7 @@
 //    case 0xD6E229D1: return "guid_header_2_0";
     case 0x8CABDCA1: // guid_file_header
       stream_read(demuxer->stream,(char*) &fileh,sizeof(fileh));
-      printf("packets: %d  flags: %d  pack_size: %d  frame_size: %d\n",(int)fileh.packets,(int)fileh.flags,(int)fileh.packetsize,(int)fileh.frame_size);
+      if(verbose) printf("ASF: packets: %d  flags: %d  pack_size: %d  frame_size: %d\n",(int)fileh.packets,(int)fileh.flags,(int)fileh.packetsize,(int)fileh.frame_size);
       asf_packet=malloc(fileh.packetsize); // !!!
       break;
     case 0x75b22636: // guid_data_chunk
--- a/dec_audio.c	Wed Apr 11 00:47:05 2001 +0000
+++ b/dec_audio.c	Wed Apr 11 01:38:57 2001 +0000
@@ -29,7 +29,7 @@
   driver=0;
 #else
   // Win32 DShow audio codec:
-  printf("DShow_audio: channs=%d  rate=%d\n",sh_audio->channels,sh_audio->samplerate);
+//  printf("DShow_audio: channs=%d  rate=%d\n",sh_audio->channels,sh_audio->samplerate);
 
   if(DS_AudioDecoder_Open(sh_audio->codec->dll,&sh_audio->codec->guid,&sh_audio->wf)){
     printf("ERROR: Could not load/initialize Win32/DirctShow AUDIO codec: %s\n",sh_audio->codec->dll);
--- a/help_avp.h	Wed Apr 11 00:47:05 2001 +0000
+++ b/help_avp.h	Wed Apr 11 01:38:57 2001 +0000
@@ -1,5 +1,5 @@
 static char* banner_text=
-"\n"
+"\n\n"
 "MPlayer v0.10 [AVI parser]  (C) 2000. Arpad Gereoffy <arpi@esp-team.scene.hu>\n"
 "\n";
 
--- a/help_mp.h	Wed Apr 11 00:47:05 2001 +0000
+++ b/help_mp.h	Wed Apr 11 01:38:57 2001 +0000
@@ -1,5 +1,5 @@
 static char* banner_text=
-"\n"
+"\n\n"
 "MPlayer " VERSION "       (C) 2000-2001 Arpad Gereoffy <arpi@esp-team.scene.hu>\n"
 "\n";
 
--- a/libvo/font_load.c	Wed Apr 11 00:47:05 2001 +0000
+++ b/libvo/font_load.c	Wed Apr 11 01:38:57 2001 +0000
@@ -242,7 +242,7 @@
 desc->font[' ']=-1;
 desc->width[' ']=desc->spacewidth;
 
-printf("font: Font %s loaded successfully! (%d chars)\n",fname,chardb);
+printf("Font %s loaded successfully! (%d chars)\n",fname,chardb);
 
 return desc;
 }
--- a/libvo/vo_xmga.c	Wed Apr 11 00:47:05 2001 +0000
+++ b/libvo/vo_xmga.c	Wed Apr 11 01:38:57 2001 +0000
@@ -103,7 +103,7 @@
          XGetGeometry( mDisplay,mWindow,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth );
          drwX=0; drwY=0; // drwWidth=wndWidth; drwHeight=wndHeight;
          XTranslateCoordinates( mDisplay,mWindow,mRoot,0,0,&drwcX,&drwcY,&mRoot );
-         fprintf( stderr,"[xmga] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
+         //fprintf( stderr,"[xmga] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
 
          if ( mFullscreen )
           {
@@ -113,7 +113,7 @@
            drwcY+=drwY;
            drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth);
            drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight);
-           fprintf( stderr,"[xmga-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
+           //fprintf( stderr,"[xmga-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
           }
 
          mDrawColorKey();
@@ -133,7 +133,7 @@
          set_window();
          if ( ioctl( f,MGA_VID_CONFIG,&mga_vid_config ) )
           {
-           fprintf( stderr,"Error in mga_vid_config ioctl" );
+           fprintf( stderr,"Error in mga_vid_config ioctl (wrong mga_vid.o version?)" );
 //           exit( 0 );
           }
 
@@ -200,7 +200,7 @@
  mDisplay=XOpenDisplay(name);
  if ( mDisplay == NULL )
   {
-   fprintf( stderr,"Can not open display\n" );
+   fprintf( stderr,"Can not open X11 display\n" );
    return -1;
   }
 
--- a/loader/driver.c	Wed Apr 11 00:47:05 2001 +0000
+++ b/loader/driver.c	Wed Apr 11 01:38:57 2001 +0000
@@ -174,7 +174,7 @@
             GUID* id=&CLSID_Voxware;
             
             result=func(id, &IID_IClassFactory, (void**)&factory);
-            if(result || (!factory)) printf("No such class object\n");
+            if(result || (!factory)) printf("No such class object (wrong/missing GUID?)\n");
 
             printf("Calling factory->vt->CreateInstance()\n");
             printf("addr = %X\n",(unsigned int)factory->vt->CreateInstance);
@@ -221,7 +221,7 @@
          hDriver = (HDRVR) 0;
      }
      
-     printf("Successfully loaded codec %s\n",win32_codec_name);
+//     printf("Successfully loaded codec %s\n",win32_codec_name);
      
      return (hDriver);
 }
--- a/loader/dshow/DS_Filter.c	Wed Apr 11 00:47:05 2001 +0000
+++ b/loader/dshow/DS_Filter.c	Wed Apr 11 01:38:57 2001 +0000
@@ -54,13 +54,13 @@
 
              setup_FS_Segment();
 
-            printf("Calling factory->vt->CreateInstance()\n");
+//            printf("Calling factory->vt->CreateInstance()\n");
             result=factory->vt->CreateInstance(factory, 0, &IID_IUnknown, (void**)&object);
-            printf("Calling factory->vt->Release()\n");
+//            printf("Calling factory->vt->Release()\n");
 	
 //	result=factory->vt->CreateInstance(factory, 0, &IID_IUnknown, (void**)&object);
 
-        printf("CreateInstance ok %x\n",result);
+//        printf("CreateInstance ok %x\n",result);
 
 	factory->vt->Release((IUnknown*)factory);
 	if(result || (!object)) throw FATAL("Class factory failure");
@@ -77,7 +77,7 @@
 	ULONG fetched;
 	enum_pins->vt->Reset(enum_pins);
 	result=enum_pins->vt->Next(enum_pins, (ULONG)256, (IPin**)array, &fetched);
-	printf("Pins enumeration returned %d pins, error is %x\n", fetched, result);
+//	printf("Pins enumeration returned %d pins, error is %x\n", fetched, result);
 	
 	for(int i=0; i<fetched; i++)
 	{
--- a/loader/registry.c	Wed Apr 11 00:47:05 2001 +0000
+++ b/loader/registry.c	Wed Apr 11 01:38:57 2001 +0000
@@ -265,7 +265,9 @@
 
 static void init_registry()
 {
+#ifdef DETAILED_OUT
 	printf("Initializing registry\n");
+#endif
 	open_registry();
 	insert_handle(HKEY_LOCAL_MACHINE, "HKLM");
 	insert_handle(HKEY_CURRENT_USER, "HKCU");
--- a/loader/setup_FS.c	Wed Apr 11 00:47:05 2001 +0000
+++ b/loader/setup_FS.c	Wed Apr 11 01:38:57 2001 +0000
@@ -56,11 +56,15 @@
 
 void setup_FS_Segment()
 {
+#ifdef DETAILED_OUT
     printf("Setup FS...");fflush(stdout);
+#endif
     __asm__ __volatile__(
 	"movl %0,%%eax; movw %%ax, %%fs" : : "i" (TEB_SEL)
     );
+#ifdef DETAILED_OUT
     printf("OK!\n");
+#endif
 }
 
 
--- a/loader/win32.c	Wed Apr 11 00:47:05 2001 +0000
+++ b/loader/win32.c	Wed Apr 11 01:38:57 2001 +0000
@@ -1577,7 +1577,6 @@
 {
     char qq[256];
     int result;
-    printf("They want library [%s] %s\n", def_path, name);
     if(strncmp(name, "c:\\windows\\", 11)==0)name+=11;
     if(name[0]!='/')
     {
@@ -1588,9 +1587,10 @@
 	else
 	    strcat(qq, name);
     }
-    printf("Entering LoadLibraryA(%s)\n", name);
+    printf("Loading DLL: %s\n", qq);
+//    printf("Entering LoadLibraryA(%s)\n", name);
     result=LoadLibraryA(qq);
-    printf("Returned LoadLibraryA(0x%x='%s'), def_path=%s => 0x%x\n", name, name, def_path, result);
+//    printf("Returned LoadLibraryA(0x%x='%s'), def_path=%s => 0x%x\n", name, name, def_path, result);
     return result;
 }      
 int WINAPI expFreeLibrary(int module)
@@ -2345,8 +2345,8 @@
                              LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count )
 {
  
- printf("RegEnumValueA(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
-   hkey, index, value, val_count, reserved, type, data, count );
+// printf("RegEnumValueA(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
+//   hkey, index, value, val_count, reserved, type, data, count );
 
  return -1;
 }
--- a/mplayer.c	Wed Apr 11 00:47:05 2001 +0000
+++ b/mplayer.c	Wed Apr 11 01:38:57 2001 +0000
@@ -323,7 +323,7 @@
 
 void exit_player(char* how){
   if(how) printf("\nExiting... (%s)\n",how);
-  printf("max framesize was %d bytes\n",max_framesize);
+  if(verbose) printf("max framesize was %d bytes\n",max_framesize);
   // restore terminal:
   getch2_disable();
 #ifdef HAVE_CODECCTRL
@@ -789,7 +789,7 @@
     printf("Can't find codec for audio format 0x%X !\n",sh_audio->format);
     has_audio=0;
   } else {
-    printf("Found audio codec: %s drv=%d (%s)\n",sh_audio->codec->name,sh_audio->codec->driver,sh_audio->codec->info);
+    printf("Found audio codec: [%s] drv:%d (%s)\n",sh_audio->codec->name,sh_audio->codec->driver,sh_audio->codec->info);
     has_audio=sh_audio->codec->driver;
   }
 }
@@ -800,7 +800,7 @@
   if(!has_audio){
     printf("Couldn't initialize audio codec! -> nosound\n");
   } else {
-    printf("AUDIO: samplerate=%d  channels=%d  bps=%d\n",has_audio,sh_audio->samplerate,sh_audio->channels,sh_audio->samplesize);
+    printf("AUDIO: samplerate=%d  channels=%d  bps=%d\n",sh_audio->samplerate,sh_audio->channels,sh_audio->samplesize);
   }
 }
 
@@ -814,7 +814,7 @@
 }
 has_video=sh_video->codec->driver;
 
-printf("Found video codec: %s drv=%d (%s)\n",sh_video->codec->name,sh_video->codec->driver,sh_video->codec->info);
+printf("Found video codec: [%s] drv:%d (%s)\n",sh_video->codec->name,sh_video->codec->driver,sh_video->codec->info);
 
 for(i=0;i<CODECS_MAX_OUTFMT;i++){
     out_fmt=sh_video->codec->outfmt[i];
@@ -1036,8 +1036,25 @@
      if(screen_size_y<=8) screen_size_y*=movie_size_y;
    }
 
-   if(verbose) printf("Destination size: %d x %d  out_fmt=%0X\n",
-                      screen_size_x,screen_size_y,out_fmt);
+   { const vo_info_t *info = video_out->get_info();
+     printf("VO: [%s] %dx%d => %dx%d %s%s%s ",info->short_name,
+         movie_size_x,movie_size_y,
+         screen_size_x,screen_size_y,
+         fullscreen?"fs ":"",
+         vidmode?"vm ":"",
+         softzoom?"zoom ":""
+//         fullscreen|(vidmode<<1)|(softzoom<<2)
+     );
+     if((out_fmt&IMGFMT_BGR_MASK)==IMGFMT_BGR)
+       printf("BGR%d\n",out_fmt&255); else
+     if((out_fmt&IMGFMT_BGR_MASK)==IMGFMT_RGB)
+       printf("RGB%d\n",out_fmt&255); else
+     if(out_fmt==IMGFMT_YUY2) printf("YUY2\n"); else
+     if(out_fmt==IMGFMT_YV12) printf("YV12\n");
+   }
+
+//   if(verbose) printf("Destination size: %d x %d  out_fmt=%0X\n",
+//                      screen_size_x,screen_size_y,out_fmt);
 
    if(verbose) printf("video_out->init(%dx%d->%dx%d,flags=%d,'%s',0x%X)\n",
                       movie_size_x,movie_size_y,
@@ -1193,9 +1210,7 @@
 }
 
 
-if(has_audio){
-  printf("Audio: type: %d  samplerate: %d  channels: %d  bps: %d\n",has_audio,sh_audio->samplerate,sh_audio->channels,sh_audio->samplesize);
-} else {
+if(!has_audio){
   printf("Audio: no sound\n");
   if(verbose) printf("Freeing %d unused audio chunks\n",d_audio->packs);
   ds_free_packs(d_audio); // free buffered chunks
@@ -1216,10 +1231,12 @@
   a_pts=d_audio->pts-(buffer_delay+audio_delay);
   audio_delay-=(float)(sh_audio->audio.dwInitialFrames-sh_video->video.dwInitialFrames)/default_fps;
 //  audio_delay-=(float)(sh_audio->audio.dwInitialFrames-sh_video->video.dwInitialFrames)/default_fps;
-  printf("AVI Initial frame delay: %5.3f\n",(float)(sh_audio->audio.dwInitialFrames-sh_video->video.dwInitialFrames)/default_fps);
-  printf("v: audio_delay=%5.3f  buffer_delay=%5.3f  a_pts=%5.3f  a_frame=%5.3f\n",
-           audio_delay,buffer_delay,a_pts,a_frame);
-  printf("START:  a_pts=%5.3f  v_pts=%5.3f  \n",d_audio->pts,d_video->pts);
+  if(verbose){
+    printf("AVI Initial frame delay: %5.3f\n",(float)(sh_audio->audio.dwInitialFrames-sh_video->video.dwInitialFrames)/default_fps);
+    printf("v: audio_delay=%5.3f  buffer_delay=%5.3f  a_pts=%5.3f  a_frame=%5.3f\n",
+             audio_delay,buffer_delay,a_pts,a_frame);
+    printf("START:  a_pts=%5.3f  v_pts=%5.3f  \n",d_audio->pts,d_video->pts);
+  }
   delay_corrected=0; // has to correct PTS diffs
   d_video->pts=0;d_audio->pts=0; // PTS is outdated now!
 }
@@ -1616,6 +1633,7 @@
         audio_delay+=x;
         //a_pts-=x;
         delay_corrected=1;
+        if(verbose)
         printf("v: audio_delay=%5.3f  buffer_delay=%5.3f  a.pts=%5.3f  v.pts=%5.3f\n",
                audio_delay,buffer_delay,d_audio->pts,d_video->pts);
       }