[MPlayer-cvslog] CVS: main/libmpdemux asf_streaming.c, 1.62, 1.63 asfheader.c, 1.45, 1.46 aviheader.c, 1.70, 1.71 demux_asf.c, 1.44, 1.45 demux_audio.c, 1.47, 1.48 demux_lavf.c, 1.28, 1.29 demux_mov.c, 1.143, 1.144 demux_ogg.c, 1.89, 1.90 demux_real.c, 1.92, 1.93 demuxer.c, 1.217, 1.218 http.c, 1.35, 1.36 stream.c, 1.87, 1.88 video.c, 1.59, 1.60

Diego Biurrun CVS syncmail at mplayerhq.hu
Fri Mar 24 09:12:07 CET 2006


CVS change done by Diego Biurrun CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv19521/libmpdemux

Modified Files:
	asf_streaming.c asfheader.c aviheader.c demux_asf.c 
	demux_audio.c demux_lavf.c demux_mov.c demux_ogg.c 
	demux_real.c demuxer.c http.c stream.c video.c 
Log Message:
Convert all if(verbose>X) to mp_msg_test calls.


Index: asf_streaming.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/asf_streaming.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- asf_streaming.c	12 Mar 2006 22:29:27 -0000	1.62
+++ asf_streaming.c	24 Mar 2006 08:12:02 -0000	1.63
@@ -31,7 +31,6 @@
 	((guid)[3] << 24 | (guid)[2] << 16 | (guid)[1] << 8 | (guid)[0])
 #endif
 
-extern int verbose;
 extern int network_bandwidth;
 
 int asf_mmst_streaming_start( stream_t *stream );
@@ -759,7 +758,7 @@
 			}
 			http_response_append( http_hdr, buffer, i );
 		} while( !http_is_header_entire( http_hdr ) );
-		if( verbose>0 ) {
+		if( mp_msg_test(MSGT_NETWORK,MSGL_V) ) {
 			http_hdr->buffer[http_hdr->buffer_size]='\0';
 			mp_msg(MSGT_NETWORK,MSGL_DBG2,"Response [%s]\n", http_hdr->buffer );
 		}

Index: asfheader.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/asfheader.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- asfheader.c	31 Oct 2005 23:37:41 -0000	1.45
+++ asfheader.c	24 Mar 2006 08:12:02 -0000	1.46
@@ -5,8 +5,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-extern int verbose; // defined in mplayer.c
-
 #include "config.h"
 #include "mp_msg.h"
 #include "help_mp.h"
@@ -212,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(verbose>=1) print_wave_header(sh_audio->wf);
+        if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf);
 	if(ASF_LOAD_GUID_PREFIX(streamh->concealment)==ASF_GUID_PREFIX_audio_conceal_interleave){
           buffer = &hdr[pos];
           pos += streamh->stream_size;
@@ -240,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(verbose>=1) print_video_header(sh_video->bih);
+        if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_video_header(sh_video->bih);
         //asf_video_id=streamh.stream_no & 0x7F;
 	//if(demuxer->video->id==-1) demuxer->video->id=streamh.stream_no & 0x7F;
         break;
@@ -283,7 +281,7 @@
           string = &hdr[pos];
           pos += contenth->title_size;
           if (pos > hdr_len) goto len_err_out;
-          if(verbose>0)
+          if( mp_msg_test(MSGT_HEADER,MSGL_V) )
             print_asf_string(" Title: ", string, contenth->title_size);
 	  else
 	    pack_asf_string(string, contenth->title_size);
@@ -294,7 +292,7 @@
           string = &hdr[pos];
           pos += contenth->author_size;
           if (pos > hdr_len) goto len_err_out;
-          if(verbose>0)
+          if( mp_msg_test(MSGT_HEADER,MSGL_V) )
             print_asf_string(" Author: ", string, contenth->author_size);
 	  else
 	    pack_asf_string(string, contenth->author_size);
@@ -305,7 +303,7 @@
           string = &hdr[pos];
           pos += contenth->copyright_size;
           if (pos > hdr_len) goto len_err_out;
-          if(verbose>0)
+          if( mp_msg_test(MSGT_HEADER,MSGL_V) )
             print_asf_string(" Copyright: ", string, contenth->copyright_size);
 	  else
 	    pack_asf_string(string, contenth->copyright_size);
@@ -316,7 +314,7 @@
           string = &hdr[pos];
           pos += contenth->comment_size;
           if (pos > hdr_len) goto len_err_out;
-          if(verbose>0)
+          if( mp_msg_test(MSGT_HEADER,MSGL_V) )
             print_asf_string(" Comment: ", string, contenth->comment_size);
 	  else
 	    pack_asf_string(string, contenth->comment_size);
@@ -327,7 +325,7 @@
           string = &hdr[pos];
           pos += contenth->rating_size;
           if (pos > hdr_len) goto len_err_out;
-          if(verbose>0)
+          if( mp_msg_test(MSGT_HEADER,MSGL_V) )
             print_asf_string(" Rating: ", string, contenth->rating_size);
         }
 	mp_msg(MSGT_HEADER,MSGL_V,"\n");
@@ -418,7 +416,7 @@
 } else if (best_video > 0 && demuxer->video->id == -1) demuxer->video->id = best_video;
 
 #if 0
-if(verbose){
+if( mp_msg_test(MSGT_HEADER,MSGL_V) ){
     printf("ASF duration: %d\n",(int)fileh.duration);
     printf("ASF start pts: %d\n",(int)fileh.start_timestamp);
     printf("ASF end pts: %d\n",(int)fileh.end_timestamp);

Index: aviheader.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/aviheader.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- aviheader.c	9 Feb 2006 00:40:35 -0000	1.70
+++ aviheader.c	24 Mar 2006 08:12:02 -0000	1.71
@@ -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(verbose>0) print_avih(&avih); // else print_avih_flags(&avih);
+      if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_avih(&avih); // else print_avih_flags(&avih);
       break;
     case ckidSTREAMHEADER: {      // read 'strh'
       AVIStreamHeader h;
@@ -202,7 +202,7 @@
         memcpy(&sh_audio->audio,&h,sizeof(h));
       }
       last_fccType=h.fccType;
-      if(verbose>=1) print_strh(&h);
+      if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_strh(&h);
       break; }
     case mmioFOURCC('i', 'n', 'd', 'x'): {
       uint32_t i;
@@ -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(verbose>=1) print_video_header(sh_video->bih);
+        if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_video->bih);
         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(verbose>=1) print_wave_header(sh_audio->wf);
+        if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf);
 	++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(verbose>=1) print_vprp(vprp);
+	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_vprp(vprp);
 	free(vprp);
 	break;
     }
@@ -368,7 +368,7 @@
 	entry->dwFlags&=0xffff;
       }
       chunksize-=priv->idx_size<<4;
-      if(verbose>=2) print_index(priv->idx,priv->idx_size);
+      if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size);
     }
     break;
     /* added May 2002 */
@@ -539,7 +539,7 @@
 	}
     }
 
-    if (verbose>=2) print_index(priv->idx, priv->idx_size);
+    if ( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx, priv->idx_size);
 
     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(verbose>=2) print_index(priv->idx,priv->idx_size);
+  if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size);
 
   /* Write generated index to a file */
   if (index_file_save) {

Index: demux_asf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_asf.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- demux_asf.c	17 Feb 2006 01:57:40 -0000	1.44
+++ demux_asf.c	24 Mar 2006 08:12:02 -0000	1.45
@@ -178,7 +178,7 @@
             unsigned char segsizetype=0x80;
             int seg=-1;
             
-            if(verbose>1){
+            if( mp_msg_test(MSGT_DEMUX,MSGL_DBG2) ){
                 int i;
                 for(i=0;i<16;i++) printf(" %02X",asf_packet[i]);
                 printf("\n");
@@ -260,7 +260,7 @@
 
               if(p>=p_end) mp_msg(MSGT_DEMUX,MSGL_V,"Warning! invalid packet 1, sig11 coming soon...\n");
 
-              if(verbose>1){
+              if( mp_msg_test(MSGT_DEMUX,MSGL_DBG2) ){
                 int i;
                 printf("seg %d:",seg);
                 for(i=0;i<16;i++) printf(" %02X",p[i]);

Index: demux_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_audio.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- demux_audio.c	20 Mar 2006 20:06:04 -0000	1.47
+++ demux_audio.c	24 Mar 2006 08:12:02 -0000	1.48
@@ -438,7 +438,7 @@
      }
     }
 
-    if(verbose>0) print_wave_header(w);
+    if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_wave_header(w);
     if(l)
       stream_skip(s,l);
     do

Index: demux_lavf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_lavf.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- demux_lavf.c	17 Feb 2006 01:57:40 -0000	1.28
+++ demux_lavf.c	24 Mar 2006 08:12:02 -0000	1.29
@@ -237,7 +237,7 @@
                 sh_audio->format = 0x7;
                 break;
             }
-            if(verbose>=1) print_wave_header(sh_audio->wf);
+            if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf);
             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(verbose>=1) print_video_header(sh_video->bih);
+            if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_video->bih);
 /*    short 	biPlanes;
     int  	biXPelsPerMeter;
     int  	biYPelsPerMeter;

Index: demux_mov.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mov.c,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -r1.143 -r1.144
--- demux_mov.c	14 Mar 2006 00:02:42 -0000	1.143
+++ demux_mov.c	24 Mar 2006 08:12:02 -0000	1.144
@@ -1802,7 +1802,7 @@
     }
 
 #if 1
-    if(verbose>2){
+    if( mp_msg_test(MSGT_DEMUX,MSGL_DBG3) ){
 	for(t_no=0;t_no<priv->track_db;t_no++){
 	    mov_track_t* trak=priv->tracks[t_no];
 	    if(trak->type==MOV_TRAK_GENERIC){

Index: demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ogg.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- demux_ogg.c	8 Mar 2006 22:23:21 -0000	1.89
+++ demux_ogg.c	24 Mar 2006 08:12:02 -0000	1.90
@@ -993,7 +993,7 @@
 		   (int)inf.version_minor, 
 		   (int)inf.version_subminor, 
 		   n_video - 1);
-	    if(verbose>0) print_video_header(sh_v->bih);
+	    if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih);
 	}
 #   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(verbose>0) print_video_header(sh_v->bih);
+	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih);
 	// 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(verbose>0) print_wave_header(sh_a->wf);
+	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf);
       } 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(verbose>0) print_video_header(sh_v->bih);
+	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih);
 	/// 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(verbose>0) print_wave_header(sh_a->wf);
+	if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf);
 
 	/// Check for text (subtitles) header
       } else if (strncmp(st->streamtype, "text", 4) == 0) {

Index: demux_real.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_real.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- demux_real.c	11 Mar 2006 16:42:46 -0000	1.92
+++ demux_real.c	24 Mar 2006 08:12:02 -0000	1.93
@@ -159,7 +159,7 @@
     real_index_table_t *index;
     int i, entries;
 
-    if (verbose<=1)
+    if ( mp_msg_test(MSGT_DEMUX,MSGL_V) )
 	return;
     
     if (stream_id >= MAX_STREAMS)
@@ -1448,7 +1448,7 @@
 		    sh->wf->wFormatTag = sh->format;
 		    
 		    mp_msg(MSGT_DEMUX,MSGL_V,"audio fourcc: %.4s (%x)\n", (char *)&sh->format, sh->format);
-		    if (verbose > 0)
+		    if ( mp_msg_test(MSGT_DEMUX,MSGL_V) )
 		    print_wave_header(sh->wf);
 
 		    /* Select audio stream with highest bitrate if multirate file*/

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -r1.217 -r1.218
--- demuxer.c	17 Feb 2006 01:57:41 -0000	1.217
+++ demuxer.c	24 Mar 2006 08:12:02 -0000	1.218
@@ -340,7 +340,7 @@
 int ds_fill_buffer(demux_stream_t *ds){
   demuxer_t *demux=ds->demuxer;
   if(ds->current) free_demux_packet(ds->current);
-  if(verbose>2){
+  if( mp_msg_test(MSGT_DEMUXER,MSGL_DBG3) ){
     if(ds==demux->audio) mp_dbg(MSGT_DEMUXER,MSGL_DBG3,"ds_fill_buffer(d_audio) called\n");else
     if(ds==demux->video) mp_dbg(MSGT_DEMUXER,MSGL_DBG3,"ds_fill_buffer(d_video) called\n");else
     if(ds==demux->sub)   mp_dbg(MSGT_DEMUXER,MSGL_DBG3,"ds_fill_buffer(d_sub) called\n");else

Index: http.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/http.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- http.c	8 Mar 2006 15:14:08 -0000	1.35
+++ http.c	24 Mar 2006 08:12:02 -0000	1.36
@@ -735,7 +735,7 @@
 		}
 
 		stream->fd=fd;
-		if( verbose>0 ) {
+		if( mp_msg_test(MSGT_NETWORK,MSGL_V) ) {
 			http_debug_hdr( http_hdr );
 		}
 		

Index: stream.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- stream.c	16 Mar 2006 14:24:22 -0000	1.87
+++ stream.c	24 Mar 2006 08:12:02 -0000	1.88
@@ -32,7 +32,6 @@
 #include "m_struct.h"
 
 
-extern int verbose; // defined in mplayer.c
 void cache_uninit(stream_t *s); // defined in cache2.c
 
 //#include "vcd_read_bincue.h"
@@ -246,7 +245,7 @@
 int stream_seek_long(stream_t *s,off_t pos){
 off_t newpos=0;
 
-//  if(verbose>=3) printf("seek_long to 0x%X\n",(unsigned int)pos);
+//  if( mp_msg_test(MSGT_STREAM,MSGL_DBG3) ) printf("seek_long to 0x%X\n",(unsigned int)pos);
 
   s->buf_pos=s->buf_len=0;
 
@@ -271,7 +270,7 @@
     break;
   }
 
-if(verbose>=3){
+if( mp_msg_test(MSGT_STREAM,MSGL_DBG3) ){
   printf("s->pos=%"PRIX64"  newpos=%"PRIX64"  new_bufpos=%"PRIX64"  buflen=%X  \n",
     (int64_t)s->pos,(int64_t)newpos,(int64_t)pos,s->buf_len);
 }

Index: video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/video.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- video.c	8 Jan 2006 14:03:41 -0000	1.59
+++ video.c	24 Mar 2006 08:12:02 -0000	1.60
@@ -285,7 +285,7 @@
       int i=sync_video_packet(d_video);
       if(i==0x1B3) break; // found it!
       if(!i || !skip_video_packet(d_video)){
-        if(verbose>0)  mp_msg(MSGT_DECVIDEO,MSGL_V,"NONE :(\n");
+        if( mp_msg_test(MSGT_DECVIDEO,MSGL_V) )  mp_msg(MSGT_DECVIDEO,MSGL_V,"NONE :(\n");
         mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MpegNoSequHdr);
 	return 0;
       }




More information about the MPlayer-cvslog mailing list