changeset 17977:f70772d02eaa

Convert printfs in aviprint.c to mp_msg and give the information printing functions in this file a verbosity_level parameter.
author diego
date Mon, 27 Mar 2006 17:25:41 +0000
parents 4c22d2209563
children d026c9bb2938
files TOOLS/asfinfo.c libmpcodecs/ad_acm.c libmpcodecs/ad_twin.c libmpcodecs/vd_vfw.c libmpdemux/asfheader.c libmpdemux/aviheader.c libmpdemux/aviprint.c libmpdemux/demux_audio.c libmpdemux/demux_lavf.c libmpdemux/demux_ogg.c libmpdemux/demux_real.c libmpdemux/demux_realaud.c loader/dmo/DMO_AudioDecoder.c loader/dshow/DS_AudioDecoder.c mencoder.c
diffstat 15 files changed, 146 insertions(+), 146 deletions(-) [+]
line wrap: on
line diff
--- a/TOOLS/asfinfo.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/TOOLS/asfinfo.c	Mon Mar 27 17:25:41 2006 +0000
@@ -105,7 +105,7 @@
   return NULL;
 }
 
-void print_wave_header(WAVEFORMATEX *h){
+void print_wave_header(WAVEFORMATEX *h,MSGL_INFO){
 
   printf("======= WAVE Format =======\n");
   
@@ -135,7 +135,7 @@
 
 }
 
-void print_video_header(BITMAPINFOHEADER *h){
+void print_video_header(BITMAPINFOHEADER *h,MSGL_INFO){
   printf("======= VIDEO Format ======\n");
 	printf("  biSize %d\n", h->biSize);
 	printf("  biWidth %d\n", h->biWidth);
@@ -176,10 +176,10 @@
       fread(buffer,streamh.type_size,1,f);
       switch(*((unsigned int*)&streamh.type)){
       case 0xF8699E40:  // guid_audio_stream
-        print_wave_header((WAVEFORMATEX*)buffer);
+        print_wave_header((WAVEFORMATEX*)buffer,MSGL_INFO);
         break;
       case 0xBC19EFC0:  // guid_video_stream
-        print_video_header((BITMAPINFOHEADER*)&buffer[4+4+1+2]);
+        print_video_header((BITMAPINFOHEADER*)&buffer[4+4+1+2],MSGL_INFO);
         break;
       }
       // stream-specific data:
--- a/libmpcodecs/ad_acm.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/libmpcodecs/ad_acm.c	Mon Mar 27 17:25:41 2006 +0000
@@ -40,7 +40,7 @@
   return 1;
 }
 
-extern void print_wave_header(WAVEFORMATEX *h);
+extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
 
 static int preinit(sh_audio_t *sh_audio)
 {
@@ -77,9 +77,9 @@
     if ( mp_msg_test(MSGT_DECAUDIO,MSGL_V) )
     {
 	mp_msg(MSGT_DECAUDIO, MSGL_V, "Input format:\n");
-	print_wave_header(in_fmt);
+	print_wave_header(in_fmt, MSGL_V);
 	mp_msg(MSGT_DECAUDIO, MSGL_V, "Output format:\n");
-	print_wave_header(priv->o_wf);
+	print_wave_header(priv->o_wf, MSGL_V);
     }
 
     MSACM_RegisterDriver((const char *)sh_audio->codec->dll, in_fmt->wFormatTag, 0);
--- a/libmpcodecs/ad_twin.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/libmpcodecs/ad_twin.c	Mon Mar 27 17:25:41 2006 +0000
@@ -90,7 +90,7 @@
      TvqGetNumFixedBitsPerFrame;
 }
 
-extern void print_wave_header(WAVEFORMATEX *h);
+extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
 static int init_vqf_audio_codec(sh_audio_t *sh_audio){
     WAVEFORMATEX *in_fmt=sh_audio->wf;
     vqf_priv_t*priv=sh_audio->context;
@@ -113,9 +113,9 @@
     if( mp_msg_test(MSGT_DECAUDIO,MSGL_V) )
     {
     mp_msg(MSGT_DECAUDIO, MSGL_V, "Input format:\n");
-    print_wave_header(in_fmt);
+    print_wave_header(in_fmt, MSGL_V);
     mp_msg(MSGT_DECAUDIO, MSGL_V, "Output fmt:\n");
-    print_wave_header(&priv->o_wf);
+    print_wave_header(&priv->o_wf, MSGL_V);
     }
     memcpy(&priv->hi,&in_fmt[1],sizeof(headerInfo));
     if((ver=TvqInitialize(&priv->hi,&priv->index,0))){
--- a/libmpcodecs/vd_vfw.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/libmpcodecs/vd_vfw.c	Mon Mar 27 17:25:41 2006 +0000
@@ -138,7 +138,7 @@
     return CONTROL_UNKNOWN;
 }
 
-extern void print_video_header(BITMAPINFOHEADER *h);
+extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level);
 
 // init driver
 static int init(sh_video_t *sh){
@@ -241,9 +241,9 @@
 	set_csp(priv->o_bih,sh->codec->outfmt[sh->outfmtidx]);
 
     mp_msg(MSGT_WIN32, MSGL_V, "Input format:\n");
-    if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh->bih);
+    if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh->bih,MSGL_V);
     mp_msg(MSGT_WIN32, MSGL_V, "Output format:\n");
-    if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(priv->o_bih);
+    if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(priv->o_bih,MSGL_V);
 
     // set postprocessing level in xvid/divx4 .dll
     ICSendMessage(priv->handle, ICM_USER+80, (long)(&divx_quality), 0);
--- a/libmpdemux/asfheader.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/libmpdemux/asfheader.c	Mon Mar 27 17:25:41 2006 +0000
@@ -137,8 +137,8 @@
   return DEMUXER_TYPE_ASF;
 }
 
-extern void print_wave_header(WAVEFORMATEX *h);
-extern void print_video_header(BITMAPINFOHEADER *h);
+extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
+extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level);
 
 int find_asf_guid(char *buf, const char *guid, int cur_pos, int buf_len)
 {
@@ -210,7 +210,7 @@
         sh_audio->wf=calloc((streamh->type_size<sizeof(WAVEFORMATEX))?sizeof(WAVEFORMATEX):streamh->type_size,1);
         memcpy(sh_audio->wf,buffer,streamh->type_size);
 	le2me_WAVEFORMATEX(sh_audio->wf);
-        if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf);
+        if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf,MSGL_V);
 	if(ASF_LOAD_GUID_PREFIX(streamh->concealment)==ASF_GUID_PREFIX_audio_conceal_interleave){
           buffer = &hdr[pos];
           pos += streamh->stream_size;
@@ -238,7 +238,7 @@
 	  mp_msg(MSGT_DEMUXER, MSGL_WARN, MSGTR_MPDEMUX_ASFHDR_DVRWantsLibavformat);
         //sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
         //sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
-        if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_video_header(sh_video->bih);
+        if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_video_header(sh_video->bih, MSGL_V);
         //asf_video_id=streamh.stream_no & 0x7F;
 	//if(demuxer->video->id==-1) demuxer->video->id=streamh.stream_no & 0x7F;
         break;
--- a/libmpdemux/aviheader.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/libmpdemux/aviheader.c	Mon Mar 27 17:25:41 2006 +0000
@@ -20,15 +20,15 @@
 
 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_video_header(BITMAPINFOHEADER *h);
-extern void print_index(AVIINDEXENTRY *idx,int idx_size);
-extern void print_avistdindex_chunk(avistdindex_chunk *h);
-extern void print_avisuperindex_chunk(avisuperindex_chunk *h);
-extern void print_vprp(VideoPropHeader *vprp);
+extern void print_avih(MainAVIHeader *h, int verbose_level);
+extern void print_avih_flags(MainAVIHeader *h, int verbose_level);
+extern void print_strh(AVIStreamHeader *h, int verbose_level);
+extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
+extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level);
+extern void print_index(AVIINDEXENTRY *idx,int idx_size, int verbose_level);
+extern void print_avistdindex_chunk(avistdindex_chunk *h, int verbose_level);
+extern void print_avisuperindex_chunk(avisuperindex_chunk *h, int verbose_level);
+extern void print_vprp(VideoPropHeader *vprp, int verbose_level);
 
 static int odml_get_vstream_id(int id, unsigned char res[])
 {
@@ -185,7 +185,7 @@
       stream_read(demuxer->stream,(char*) &avih,MIN(size2,sizeof(avih)));
       le2me_MainAVIHeader(&avih); // swap to machine endian
       chunksize-=MIN(size2,sizeof(avih));
-      if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_avih(&avih); // else print_avih_flags(&avih);
+      if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_avih(&avih,MSGL_V); // else print_avih_flags(&avih,MSGL_V);
       break;
     case ckidSTREAMHEADER: {      // read 'strh'
       AVIStreamHeader h;
@@ -202,7 +202,7 @@
         memcpy(&sh_audio->audio,&h,sizeof(h));
       }
       last_fccType=h.fccType;
-      if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_strh(&h);
+      if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_strh(&h,MSGL_V);
       break; }
     case mmioFOURCC('i', 'n', 'd', 'x'): {
       uint32_t i;
@@ -223,7 +223,7 @@
       stream_read(demuxer->stream, (char *)s->dwReserved, 3*4);
       memset(s->dwReserved, 0, 3*4);
 	  
-      print_avisuperindex_chunk(s);
+      print_avisuperindex_chunk(s,MSGL_V);
 
       msize = sizeof (uint32_t) * s->wLongsPerEntry * s->nEntriesInUse;
       s->aIndex = malloc(msize);
@@ -254,7 +254,7 @@
 	// fixup MS-RLE header (seems to be broken for <256 color files)
 	if(sh_video->bih->biCompression<=1 && sh_video->bih->biSize==40)
 	    sh_video->bih->biSize=chunksize;
-        if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_video->bih);
+        if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_video->bih,MSGL_V);
         chunksize=0;
 //        sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
 //        sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
@@ -309,7 +309,7 @@
 	    sh_audio->wf=realloc(sh_audio->wf, sizeof(WAVEFORMATEX)+sh_audio->wf->cbSize);
 	}
         chunksize=0;
-        if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf);
+        if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf,MSGL_V);
 	++priv->audio_streams;
 //        if(demuxer->audio->id==-1) demuxer->audio->id=stream_id;
       }
@@ -332,7 +332,7 @@
 	if (sh_video) {
 		sh_video->aspect = GET_AVI_ASPECT(vprp->dwFrameAspectRatio);
 	}
-	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_vprp(vprp);
+	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_vprp(vprp,MSGL_V);
 	free(vprp);
 	break;
     }
@@ -368,7 +368,7 @@
 	entry->dwFlags&=0xffff;
       }
       chunksize-=priv->idx_size<<4;
-      if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size);
+      if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size,MSGL_DBG2);
     }
     break;
     /* added May 2002 */
@@ -465,7 +465,7 @@
 	    }
 
 	    le2me_AVISTDIDXCHUNK(&cx->stdidx[j]);
-	    print_avistdindex_chunk(&cx->stdidx[j]);
+	    print_avistdindex_chunk(&cx->stdidx[j],MSGL_V);
 	    priv->idx_size += cx->stdidx[j].nEntriesInUse;
 	    cx->stdidx[j].aIndex = malloc(cx->stdidx[j].nEntriesInUse*sizeof(avistdindex_entry));
 	    stream_read(demuxer->stream, (char *)cx->stdidx[j].aIndex, 
@@ -539,7 +539,7 @@
 	}
     }
 
-    if ( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx, priv->idx_size);
+    if ( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx, priv->idx_size,MSGL_DBG2);
 
     demuxer->movi_end=demuxer->stream->end_pos;
 
@@ -677,7 +677,7 @@
   }
   priv->idx_size=priv->idx_pos;
   mp_msg(MSGT_HEADER,MSGL_INFO,MSGTR_MPDEMUX_AVIHDR_IdxGeneratedForHowManyChunks,priv->idx_size);
-  if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size);
+  if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size,MSGL_DBG2);
 
   /* Write generated index to a file */
   if (index_file_save) {
--- a/libmpdemux/aviprint.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/libmpdemux/aviprint.c	Mon Mar 27 17:25:41 2006 +0000
@@ -15,8 +15,8 @@
 //#include "codec-cfg.h"
 //#include "stheader.h"
 
-void print_avih_flags(MainAVIHeader *h){
-  printf("MainAVIHeader.dwFlags: (%ld)%s%s%s%s%s%s\n",h->dwFlags,
+void print_avih_flags(MainAVIHeader *h, int verbose_level){
+  mp_msg(MSGT_HEADER, verbose_level, "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":"",
@@ -26,111 +26,111 @@
   );
 }
 
-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);
-  printf("Size:  %ld x %ld\n",h->dwWidth,h->dwHeight);
-  printf("==========================\n");
+void print_avih(MainAVIHeader *h, int verbose_level){
+  mp_msg(MSGT_HEADER, verbose_level, "======= AVI Header =======\n");
+  mp_msg(MSGT_HEADER, verbose_level, "us/frame: %ld  (fps=%5.3f)\n",h->dwMicroSecPerFrame,1000000.0f/(float)h->dwMicroSecPerFrame);
+  mp_msg(MSGT_HEADER, verbose_level, "max bytes/sec: %ld\n",h->dwMaxBytesPerSec);
+  mp_msg(MSGT_HEADER, verbose_level, "padding: %ld\n",h->dwPaddingGranularity);
+  print_avih_flags(h, verbose_level);
+  mp_msg(MSGT_HEADER, verbose_level, "frames  total: %ld   initial: %ld\n",h->dwTotalFrames,h->dwInitialFrames);
+  mp_msg(MSGT_HEADER, verbose_level, "streams: %ld\n",h->dwStreams);
+  mp_msg(MSGT_HEADER, verbose_level, "Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize);
+  mp_msg(MSGT_HEADER, verbose_level, "Size:  %ld x %ld\n",h->dwWidth,h->dwHeight);
+  mp_msg(MSGT_HEADER, verbose_level, "==========================\n");
 }
 
-void print_strh(AVIStreamHeader *h){
-  printf("====== STREAM Header =====\n");
-  printf("Type: %.4s   FCC: %.4s (%X)\n",(char *)&h->fccType,(char *)&h->fccHandler,(unsigned int)h->fccHandler);
-  printf("Flags: %ld\n",h->dwFlags);
-  printf("Priority: %d   Language: %d\n",h->wPriority,h->wLanguage);
-  printf("InitialFrames: %ld\n",h->dwInitialFrames);
-  printf("Rate: %ld/%ld = %5.3f\n",h->dwRate,h->dwScale,(float)h->dwRate/(float)h->dwScale);
-  printf("Start: %ld   Len: %ld\n",h->dwStart,h->dwLength);
-  printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize);
-  printf("Quality %ld\n",h->dwQuality);
-  printf("Sample size: %ld\n",h->dwSampleSize);
-  printf("==========================\n");
+void print_strh(AVIStreamHeader *h, int verbose_level){
+  mp_msg(MSGT_HEADER, verbose_level, "====== STREAM Header =====\n");
+  mp_msg(MSGT_HEADER, verbose_level, "Type: %.4s   FCC: %.4s (%X)\n",(char *)&h->fccType,(char *)&h->fccHandler,(unsigned int)h->fccHandler);
+  mp_msg(MSGT_HEADER, verbose_level, "Flags: %ld\n",h->dwFlags);
+  mp_msg(MSGT_HEADER, verbose_level, "Priority: %d   Language: %d\n",h->wPriority,h->wLanguage);
+  mp_msg(MSGT_HEADER, verbose_level, "InitialFrames: %ld\n",h->dwInitialFrames);
+  mp_msg(MSGT_HEADER, verbose_level, "Rate: %ld/%ld = %5.3f\n",h->dwRate,h->dwScale,(float)h->dwRate/(float)h->dwScale);
+  mp_msg(MSGT_HEADER, verbose_level, "Start: %ld   Len: %ld\n",h->dwStart,h->dwLength);
+  mp_msg(MSGT_HEADER, verbose_level, "Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize);
+  mp_msg(MSGT_HEADER, verbose_level, "Quality %ld\n",h->dwQuality);
+  mp_msg(MSGT_HEADER, verbose_level, "Sample size: %ld\n",h->dwSampleSize);
+  mp_msg(MSGT_HEADER, verbose_level, "==========================\n");
 }
 
-void print_wave_header(WAVEFORMATEX *h){
-  printf("======= WAVE Format =======\n");
-  printf("Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag);
-  printf("Channels: %d\n",h->nChannels);
-  printf("Samplerate: %ld\n",h->nSamplesPerSec);
-  printf("avg byte/sec: %ld\n",h->nAvgBytesPerSec);
-  printf("Block align: %d\n",h->nBlockAlign);
-  printf("bits/sample: %d\n",h->wBitsPerSample);
-  printf("cbSize: %d\n",h->cbSize);
+void print_wave_header(WAVEFORMATEX *h, int verbose_level){
+  mp_msg(MSGT_HEADER, verbose_level, "======= WAVE Format =======\n");
+  mp_msg(MSGT_HEADER, verbose_level, "Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag);
+  mp_msg(MSGT_HEADER, verbose_level, "Channels: %d\n",h->nChannels);
+  mp_msg(MSGT_HEADER, verbose_level, "Samplerate: %ld\n",h->nSamplesPerSec);
+  mp_msg(MSGT_HEADER, verbose_level, "avg byte/sec: %ld\n",h->nAvgBytesPerSec);
+  mp_msg(MSGT_HEADER, verbose_level, "Block align: %d\n",h->nBlockAlign);
+  mp_msg(MSGT_HEADER, verbose_level, "bits/sample: %d\n",h->wBitsPerSample);
+  mp_msg(MSGT_HEADER, verbose_level, "cbSize: %d\n",h->cbSize);
   if(h->wFormatTag==0x55 && h->cbSize>=12){
       MPEGLAYER3WAVEFORMAT* h2=(MPEGLAYER3WAVEFORMAT *)h;
-      printf("mp3.wID=%d\n",h2->wID);
-      printf("mp3.fdwFlags=0x%lX\n",h2->fdwFlags);
-      printf("mp3.nBlockSize=%d\n",h2->nBlockSize);
-      printf("mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock);
-      printf("mp3.nCodecDelay=%d\n",h2->nCodecDelay);
+      mp_msg(MSGT_HEADER, verbose_level, "mp3.wID=%d\n",h2->wID);
+      mp_msg(MSGT_HEADER, verbose_level, "mp3.fdwFlags=0x%lX\n",h2->fdwFlags);
+      mp_msg(MSGT_HEADER, verbose_level, "mp3.nBlockSize=%d\n",h2->nBlockSize);
+      mp_msg(MSGT_HEADER, verbose_level, "mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock);
+      mp_msg(MSGT_HEADER, verbose_level, "mp3.nCodecDelay=%d\n",h2->nCodecDelay);
   }
   else if (h->cbSize > 0)
   {
     int i;
     uint8_t* p = ((uint8_t*)h) + sizeof(WAVEFORMATEX);
-    printf("Unknown extra header dump: ");
+    mp_msg(MSGT_HEADER, verbose_level, "Unknown extra header dump: ");
     for (i = 0; i < h->cbSize; i++)
-	printf("[%x] ", p[i]);
-    printf("\n");
+	mp_msg(MSGT_HEADER, verbose_level, "[%x] ", p[i]);
+    mp_msg(MSGT_HEADER, verbose_level, "\n");
   }
-  printf("===========================\n");
+  mp_msg(MSGT_HEADER, verbose_level, "==========================================================================\n");
 }
 
 
-void print_video_header(BITMAPINFOHEADER *h){
-  printf("======= VIDEO Format ======\n");
-	printf("  biSize %d\n", h->biSize);
-	printf("  biWidth %d\n", h->biWidth);
-	printf("  biHeight %d\n", h->biHeight);
-	printf("  biPlanes %d\n", h->biPlanes);
-	printf("  biBitCount %d\n", h->biBitCount);
-	printf("  biCompression %d='%.4s'\n", h->biCompression, (char *)&h->biCompression);
-	printf("  biSizeImage %d\n", h->biSizeImage);
+void print_video_header(BITMAPINFOHEADER *h, int verbose_level){
+  mp_msg(MSGT_HEADER, verbose_level, "======= VIDEO Format ======\n");
+	mp_msg(MSGT_HEADER, verbose_level, "  biSize %d\n", h->biSize);
+	mp_msg(MSGT_HEADER, verbose_level, "  biWidth %d\n", h->biWidth);
+	mp_msg(MSGT_HEADER, verbose_level, "  biHeight %d\n", h->biHeight);
+	mp_msg(MSGT_HEADER, verbose_level, "  biPlanes %d\n", h->biPlanes);
+	mp_msg(MSGT_HEADER, verbose_level, "  biBitCount %d\n", h->biBitCount);
+	mp_msg(MSGT_HEADER, verbose_level, "  biCompression %d='%.4s'\n", h->biCompression, (char *)&h->biCompression);
+	mp_msg(MSGT_HEADER, verbose_level, "  biSizeImage %d\n", h->biSizeImage);
   if (h->biSize > sizeof(BITMAPINFOHEADER))
   {
     int i;
     uint8_t* p = ((uint8_t*)h) + sizeof(BITMAPINFOHEADER);
-    printf("Unknown extra header dump: ");
+    mp_msg(MSGT_HEADER, verbose_level, "Unknown extra header dump: ");
     for (i = 0; i < h->biSize-sizeof(BITMAPINFOHEADER); i++)
-	printf("[%x] ", *(p+i));
-    printf("\n");
+	mp_msg(MSGT_HEADER, verbose_level, "[%x] ", *(p+i));
+    mp_msg(MSGT_HEADER, verbose_level, "\n");
   }
-  printf("===========================\n");
+  mp_msg(MSGT_HEADER, verbose_level, "===========================\n");
 }
 
-void print_vprp(VideoPropHeader *vprp){
+void print_vprp(VideoPropHeader *vprp, int verbose_level){
   int i;
-  printf("======= Video Properties Header =======\n");
-  printf("Format: %d  VideoStandard: %d\n",
+  mp_msg(MSGT_HEADER, verbose_level, "======= Video Properties Header =======\n");
+  mp_msg(MSGT_HEADER, verbose_level, "Format: %d  VideoStandard: %d\n",
          vprp->VideoFormatToken,vprp->VideoStandard);
-  printf("VRefresh: %d  HTotal: %d  VTotal: %d\n",
+  mp_msg(MSGT_HEADER, verbose_level, "VRefresh: %d  HTotal: %d  VTotal: %d\n",
          vprp->dwVerticalRefreshRate, vprp->dwHTotalInT, vprp->dwVTotalInLines);
-  printf("FrameAspect: %d:%d  Framewidth: %d  Frameheight: %d\n",
+  mp_msg(MSGT_HEADER, verbose_level, "FrameAspect: %d:%d  Framewidth: %d  Frameheight: %d\n",
          vprp->dwFrameAspectRatio >> 16, vprp->dwFrameAspectRatio & 0xffff,
          vprp->dwFrameWidthInPixels, vprp->dwFrameHeightInLines);
-  printf("Fields: %d\n", vprp->nbFieldPerFrame);
+  mp_msg(MSGT_HEADER, verbose_level, "Fields: %d\n", vprp->nbFieldPerFrame);
   for (i=0; i<vprp->nbFieldPerFrame; i++) {
     VIDEO_FIELD_DESC *vfd = &vprp->FieldInfo[i];
-    printf("  == Field %d description ==\n", i);
-    printf("  CompressedBMHeight: %d  CompressedBMWidth: %d\n",
+    mp_msg(MSGT_HEADER, verbose_level, "  == Field %d description ==\n", i);
+    mp_msg(MSGT_HEADER, verbose_level, "  CompressedBMHeight: %d  CompressedBMWidth: %d\n",
            vfd->CompressedBMHeight, vfd->CompressedBMWidth);
-    printf("  ValidBMHeight: %d  ValidBMWidth: %d\n",
+    mp_msg(MSGT_HEADER, verbose_level, "  ValidBMHeight: %d  ValidBMWidth: %d\n",
            vfd->ValidBMHeight, vfd->ValidBMWidth);
-    printf("  ValidBMXOffset: %d  ValidBMYOffset: %d\n",
+    mp_msg(MSGT_HEADER, verbose_level, "  ValidBMXOffset: %d  ValidBMYOffset: %d\n",
            vfd->ValidBMXOffset, vfd->ValidBMYOffset);
-    printf("  VideoXOffsetInT: %d  VideoYValidStartLine: %d\n",
+    mp_msg(MSGT_HEADER, verbose_level, "  VideoXOffsetInT: %d  VideoYValidStartLine: %d\n",
            vfd->VideoXOffsetInT, vfd->VideoYValidStartLine);
   }
-  printf("=======================================\n");
+  mp_msg(MSGT_HEADER, verbose_level, "=======================================\n");
 }
 
-void print_index(AVIINDEXENTRY *idx,int idx_size){
+void print_index(AVIINDEXENTRY *idx, int idx_size, int verbose_level){
   int i;
   unsigned int pos[256];
   unsigned int num[256];
@@ -138,7 +138,7 @@
   for(i=0;i<idx_size;i++){
     int id=avi_stream_id(idx[i].ckid);
     if(id<0 || id>255) id=255;
-    printf("%5d:  %.4s  %4X  %016llX  len:%6ld  pos:%7d->%7.3f %7d->%7.3f\n",i,
+    mp_msg(MSGT_HEADER, verbose_level, "%5d:  %.4s  %4X  %016llX  len:%6ld  pos:%7d->%7.3f %7d->%7.3f\n",i,
       (char *)&idx[i].ckid,
       (unsigned int)idx[i].dwFlags&0xffff,
       (uint64_t)AVI_IDX_OFFSET(&idx[i]),
@@ -152,21 +152,21 @@
   }
 }
 
-void print_avistdindex_chunk(avistdindex_chunk *h){
-    mp_msg (MSGT_HEADER, MSGL_V, "====== AVI Standard Index Header ========\n");
-    mp_msg (MSGT_HEADER, MSGL_V, "  FCC (%.4s) dwSize (%d) wLongsPerEntry(%d)\n", h->fcc, h->dwSize, h->wLongsPerEntry);
-    mp_msg (MSGT_HEADER, MSGL_V, "  bIndexSubType (%d) bIndexType (%d)\n", h->bIndexSubType, h->bIndexType);
-    mp_msg (MSGT_HEADER, MSGL_V, "  nEntriesInUse (%d) dwChunkId (%.4s)\n", h->nEntriesInUse, h->dwChunkId);
-    mp_msg (MSGT_HEADER, MSGL_V, "  qwBaseOffset (0x%"PRIX64") dwReserved3 (%d)\n", h->qwBaseOffset, h->dwReserved3);
-    mp_msg (MSGT_HEADER, MSGL_V, "===========================\n");
+void print_avistdindex_chunk(avistdindex_chunk *h, int verbose_level){
+    mp_msg (MSGT_HEADER, verbose_level, "====== AVI Standard Index Header ========\n");
+    mp_msg (MSGT_HEADER, verbose_level, "  FCC (%.4s) dwSize (%d) wLongsPerEntry(%d)\n", h->fcc, h->dwSize, h->wLongsPerEntry);
+    mp_msg (MSGT_HEADER, verbose_level, "  bIndexSubType (%d) bIndexType (%d)\n", h->bIndexSubType, h->bIndexType);
+    mp_msg (MSGT_HEADER, verbose_level, "  nEntriesInUse (%d) dwChunkId (%.4s)\n", h->nEntriesInUse, h->dwChunkId);
+    mp_msg (MSGT_HEADER, verbose_level, "  qwBaseOffset (0x%"PRIX64") dwReserved3 (%d)\n", h->qwBaseOffset, h->dwReserved3);
+    mp_msg (MSGT_HEADER, verbose_level, "===========================\n");
 }
-void print_avisuperindex_chunk(avisuperindex_chunk *h){
-    mp_msg (MSGT_HEADER, MSGL_V, "====== AVI Super Index Header ========\n");
-    mp_msg (MSGT_HEADER, MSGL_V, "  FCC (%.4s) dwSize (%d) wLongsPerEntry(%d)\n", h->fcc, h->dwSize, h->wLongsPerEntry);
-    mp_msg (MSGT_HEADER, MSGL_V, "  bIndexSubType (%d) bIndexType (%d)\n", h->bIndexSubType, h->bIndexType);
-    mp_msg (MSGT_HEADER, MSGL_V, "  nEntriesInUse (%d) dwChunkId (%.4s)\n", h->nEntriesInUse, h->dwChunkId);
-    mp_msg (MSGT_HEADER, MSGL_V, "  dwReserved[0] (%d) dwReserved[1] (%d) dwReserved[2] (%d)\n", 
+void print_avisuperindex_chunk(avisuperindex_chunk *h, int verbose_level){
+    mp_msg (MSGT_HEADER, verbose_level, "====== AVI Super Index Header ========\n");
+    mp_msg (MSGT_HEADER, verbose_level, "  FCC (%.4s) dwSize (%d) wLongsPerEntry(%d)\n", h->fcc, h->dwSize, h->wLongsPerEntry);
+    mp_msg (MSGT_HEADER, verbose_level, "  bIndexSubType (%d) bIndexType (%d)\n", h->bIndexSubType, h->bIndexType);
+    mp_msg (MSGT_HEADER, verbose_level, "  nEntriesInUse (%d) dwChunkId (%.4s)\n", h->nEntriesInUse, h->dwChunkId);
+    mp_msg (MSGT_HEADER, verbose_level, "  dwReserved[0] (%d) dwReserved[1] (%d) dwReserved[2] (%d)\n", 
 	    h->dwReserved[0], h->dwReserved[1], h->dwReserved[2]);
-    mp_msg (MSGT_HEADER, MSGL_V, "===========================\n");
+    mp_msg (MSGT_HEADER, verbose_level, "===========================\n");
 }
 
--- a/libmpdemux/demux_audio.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/libmpdemux/demux_audio.c	Mon Mar 27 17:25:41 2006 +0000
@@ -44,7 +44,7 @@
 } mp3_hdr_t;
 
 extern void free_sh_audio(sh_audio_t* sh);
-extern void print_wave_header(WAVEFORMATEX *h);
+extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
 
 int hr_mp3_seek = 0;
 
@@ -438,7 +438,7 @@
      }
     }
 
-    if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_wave_header(w);
+    if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_wave_header(w, MSGL_V);
     if(l)
       stream_skip(s,l);
     do
--- a/libmpdemux/demux_lavf.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/libmpdemux/demux_lavf.c	Mon Mar 27 17:25:41 2006 +0000
@@ -46,8 +46,8 @@
     int64_t last_pts;
 }lavf_priv_t;
 
-extern void print_wave_header(WAVEFORMATEX *h);
-extern void print_video_header(BITMAPINFOHEADER *h);
+extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
+extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level);
 
 int64_t ff_gcd(int64_t a, int64_t b);
 
@@ -237,7 +237,7 @@
                 sh_audio->format = 0x7;
                 break;
             }
-            if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf);
+            if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf, MSGL_V);
             if(demuxer->audio->id != i && demuxer->audio->id != -1)
                 st->discard= AVDISCARD_ALL;
             else{
@@ -286,7 +286,7 @@
             sh_video->ds= demuxer->video;
             if(codec->extradata_size)
                 memcpy(sh_video->bih + 1, codec->extradata, codec->extradata_size);
-            if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_video->bih);
+            if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_video->bih, MSGL_V);
 /*    short 	biPlanes;
     int  	biXPelsPerMeter;
     int  	biYPelsPerMeter;
--- a/libmpdemux/demux_ogg.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/libmpdemux/demux_ogg.c	Mon Mar 27 17:25:41 2006 +0000
@@ -705,8 +705,8 @@
   
 }
 
-extern void print_wave_header(WAVEFORMATEX *h);
-extern void print_video_header(BITMAPINFOHEADER *h);
+extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
+extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level);
 
 /** \brief Return the number of subtitle tracks in the file.
 
@@ -993,7 +993,7 @@
 		   (int)inf.version_minor, 
 		   (int)inf.version_subminor, 
 		   n_video - 1);
-	    if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih);
+	    if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih,MSGL_V);
 	}
 #   endif /* HAVE_OGGTHEORA */
 #   ifdef HAVE_FLAC
@@ -1036,7 +1036,7 @@
 	n_video++;
 	mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: video (FOURCC %c%c%c%c), -vid %d\n",
 	       ogg_d->num_sub,pack.packet[68],pack.packet[69],pack.packet[70],pack.packet[71],n_video-1);
-	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih);
+	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih,MSGL_V);
 	// Old audio header
       } else if(get_uint32(pack.packet+96) == 0x05589F81) {
 	unsigned int extra_size;
@@ -1060,7 +1060,7 @@
 	ogg_d->subs[ogg_d->num_sub].id = n_audio;
 	n_audio++;
 	mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: audio (format 0x%04x), -aid %d\n",ogg_d->num_sub,sh_a->format,n_audio-1);
-	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf);
+	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf,MSGL_V);
       } else
 	mp_msg(MSGT_DEMUX,MSGL_WARN,"Ogg stream %d contains an old header but the header type is unknown\n",ogg_d->num_sub);
 
@@ -1092,7 +1092,7 @@
 	n_video++;
 	mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: video (FOURCC %c%c%c%c), -vid %d\n",
 	       ogg_d->num_sub,st->subtype[0],st->subtype[1],st->subtype[2],st->subtype[3],n_video-1);
-	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih);
+	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih,MSGL_V);
 	/// New audio header
       } else if(strncmp(st->streamtype,"audio",5) == 0) {
 	char buffer[5];
@@ -1131,7 +1131,7 @@
 	ogg_d->subs[ogg_d->num_sub].id = n_audio;
 	n_audio++;
 	mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: audio (format 0x%04x), -aid %d\n",ogg_d->num_sub,sh_a->format,n_audio-1);
-	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf);
+	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf,MSGL_V);
 
 	/// Check for text (subtitles) header
       } else if (strncmp(st->streamtype, "text", 4) == 0) {
@@ -1162,7 +1162,7 @@
 	// If the audio stream is not defined we took the first one
 	if(demuxer->audio->id == -1) {
 	  demuxer->audio->id = n_audio - 1;
-//	  if(sh_a->wf) print_wave_header(sh_a->wf);
+//	  if(sh_a->wf) print_wave_header(sh_a->wf,MSGL_INFO);
 	}
 	/// Is it the stream we want
 	if(demuxer->audio->id == (n_audio - 1)) {
@@ -1176,7 +1176,7 @@
 	/// Also for video
 	if(demuxer->video->id == -1) {
 	  demuxer->video->id = n_video - 1;
-//	  if(sh_v->bih) print_video_header(sh_v->bih);
+//	  if(sh_v->bih) print_video_header(sh_v->bih,MSGL_INFO);
 	}
 	if(demuxer->video->id == (n_video - 1)) {
 	  demuxer->video->sh = sh_v;
--- a/libmpdemux/demux_real.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/libmpdemux/demux_real.c	Mon Mar 27 17:25:41 2006 +0000
@@ -1070,7 +1070,7 @@
   }//    goto loop;
 }
 
-extern void print_wave_header(WAVEFORMATEX *h);
+extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
 
 static demuxer_t* demux_open_real(demuxer_t* demuxer)
 {
@@ -1449,7 +1449,7 @@
 		    
 		    mp_msg(MSGT_DEMUX,MSGL_V,"audio fourcc: %.4s (%x)\n", (char *)&sh->format, sh->format);
 		    if ( mp_msg_test(MSGT_DEMUX,MSGL_V) )
-		    print_wave_header(sh->wf);
+		    print_wave_header(sh->wf, MSGL_V);
 
 		    /* Select audio stream with highest bitrate if multirate file*/
 		    if (priv->is_multirate && ((demuxer->audio->id == -1) ||
--- a/libmpdemux/demux_realaud.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/libmpdemux/demux_realaud.c	Mon Mar 27 17:25:41 2006 +0000
@@ -144,7 +144,7 @@
 
 
 
-extern void print_wave_header(WAVEFORMATEX *h);
+extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
 
 
 
@@ -313,7 +313,7 @@
 			mp_msg(MSGT_DEMUX,MSGL_V,"Audio: Unknown (%d)\n", sh->format);
 	}
 
-	print_wave_header(sh->wf);
+	print_wave_header(sh->wf, MSGL_V);
 
 	/* disable seeking */
 	demuxer->seekable = 0;
--- a/loader/dmo/DMO_AudioDecoder.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/loader/dmo/DMO_AudioDecoder.c	Mon Mar 27 17:25:41 2006 +0000
@@ -36,7 +36,7 @@
 #define __MODULE__ "DirectShow audio decoder"
 
 typedef long STDCALL (*GETCLASS) (GUID*, GUID*, void**);
-extern void print_wave_header(WAVEFORMATEX *h);
+extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
 
 DMO_AudioDecoder * DMO_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* wf,int out_channels)
 //DMO_AudioDecoder * DMO_AudioDecoder_Create(const CodecInfo * info, const WAVEFORMATEX* wf)
@@ -89,8 +89,8 @@
     this->m_sDestType.cbFormat=18; //pWF->cbSize;
     this->m_sDestType.pbFormat=this->m_sVhdr2;
 
-print_wave_header((WAVEFORMATEX *)this->m_sVhdr);
-print_wave_header((WAVEFORMATEX *)this->m_sVhdr2);
+print_wave_header((WAVEFORMATEX *)this->m_sVhdr,  MSGL_V);
+print_wave_header((WAVEFORMATEX *)this->m_sVhdr2, MSGL_V);
 
         this->m_pDMO_Filter = DMO_FilterCreate(dllname, guid, &this->m_sOurType, &this->m_sDestType);
 	if( !this->m_pDMO_Filter ) {
--- a/loader/dshow/DS_AudioDecoder.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/loader/dshow/DS_AudioDecoder.c	Mon Mar 27 17:25:41 2006 +0000
@@ -94,8 +94,8 @@
     this->m_sDestType.cbFormat=18; //pWF->cbSize;
     this->m_sDestType.pbFormat=this->m_sVhdr2;
 
-//print_wave_header(this->m_sVhdr);
-//print_wave_header(this->m_sVhdr2);
+//print_wave_header(this->m_sVhdr,  MSGL_V);
+//print_wave_header(this->m_sVhdr2, MSGL_V);
 
     /*try*/
     {
--- a/mencoder.c	Mon Mar 27 16:43:02 2006 +0000
+++ b/mencoder.c	Mon Mar 27 17:25:41 2006 +0000
@@ -356,7 +356,7 @@
 static muxer_t* muxer=NULL;
 static FILE* muxer_f=NULL;
 
-extern void print_wave_header(WAVEFORMATEX *h);
+extern void print_wave_header(WAVEFORMATEX *h, int verbose_level);
 
 int main(int argc,char* argv[]){
 
@@ -964,7 +964,7 @@
     break;
 }
 
-if ( mp_msg_test(MSGT_MENCODER,MSGL_DBG2) ) print_wave_header(mux_a->wf);
+if ( mp_msg_test(MSGT_MENCODER,MSGL_DBG2) ) print_wave_header(mux_a->wf, MSGL_DBG2);
 
 if (! ignore_start)
     muxer->audio_delay_fix += sh_audio->stream_delay;