aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-03-24 08:12:03 +0000
committerGravatar diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-03-24 08:12:03 +0000
commiteebf08b978f91243bb6eed54012267cc27183438 (patch)
tree83ce4df0814283621f24ef1d3ea4217981046993 /libmpdemux
parent35e90f1556475ee205dee6c253b788ab073133c0 (diff)
Convert all if(verbose>X) to mp_msg_test calls.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17933 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/asf_streaming.c3
-rw-r--r--libmpdemux/asfheader.c18
-rw-r--r--libmpdemux/aviheader.c16
-rw-r--r--libmpdemux/demux_asf.c4
-rw-r--r--libmpdemux/demux_audio.c2
-rw-r--r--libmpdemux/demux_lavf.c4
-rw-r--r--libmpdemux/demux_mov.c2
-rw-r--r--libmpdemux/demux_ogg.c10
-rw-r--r--libmpdemux/demux_real.c4
-rw-r--r--libmpdemux/demuxer.c2
-rw-r--r--libmpdemux/http.c2
-rw-r--r--libmpdemux/stream.c5
-rw-r--r--libmpdemux/video.c2
13 files changed, 35 insertions, 39 deletions
diff --git a/libmpdemux/asf_streaming.c b/libmpdemux/asf_streaming.c
index 30ebc29dc7..2ddfbecc14 100644
--- a/libmpdemux/asf_streaming.c
+++ b/libmpdemux/asf_streaming.c
@@ -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 @@ static int asf_http_streaming_start( stream_t *stream, int *demuxer_type ) {
}
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 );
}
diff --git a/libmpdemux/asfheader.c b/libmpdemux/asfheader.c
index e69d94608d..72179bd445 100644
--- a/libmpdemux/asfheader.c
+++ b/libmpdemux/asfheader.c
@@ -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 @@ int read_asf_header(demuxer_t *demuxer){
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 @@ int read_asf_header(demuxer_t *demuxer){
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 @@ int read_asf_header(demuxer_t *demuxer){
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 @@ int read_asf_header(demuxer_t *demuxer){
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 @@ int read_asf_header(demuxer_t *demuxer){
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 @@ int read_asf_header(demuxer_t *demuxer){
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 @@ int read_asf_header(demuxer_t *demuxer){
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 @@ if(!video_streams){
} 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);
diff --git a/libmpdemux/aviheader.c b/libmpdemux/aviheader.c
index 19ec696bef..e360149dfe 100644
--- a/libmpdemux/aviheader.c
+++ b/libmpdemux/aviheader.c
@@ -185,7 +185,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>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 @@ while(1){
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 @@ while(1){
// 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 @@ while(1){
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 @@ while(1){
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 @@ while(1){
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 (priv->isodml && (index_mode==-1 || index_mode==0 || index_mode==1)) {
}
}
- 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 @@ skip_chunk:
}
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) {
diff --git a/libmpdemux/demux_asf.c b/libmpdemux/demux_asf.c
index c21ed166f6..343752e070 100644
--- a/libmpdemux/demux_asf.c
+++ b/libmpdemux/demux_asf.c
@@ -178,7 +178,7 @@ static int demux_asf_fill_buffer(demuxer_t *demux, demux_stream_t *ds){
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 @@ static int demux_asf_fill_buffer(demuxer_t *demux, demux_stream_t *ds){
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]);
diff --git a/libmpdemux/demux_audio.c b/libmpdemux/demux_audio.c
index 1681110c8b..880677bf5f 100644
--- a/libmpdemux/demux_audio.c
+++ b/libmpdemux/demux_audio.c
@@ -438,7 +438,7 @@ static int demux_audio_open(demuxer_t* demuxer) {
}
}
- 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
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index e2aaa64de7..057f4e315d 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -237,7 +237,7 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
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 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
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;
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index bef99cccbd..eaffa1f963 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -1802,7 +1802,7 @@ static demuxer_t* mov_read_header(demuxer_t* demuxer){
}
#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){
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
index 459d4a4461..76f97b41f0 100644
--- a/libmpdemux/demux_ogg.c
+++ b/libmpdemux/demux_ogg.c
@@ -993,7 +993,7 @@ int demux_ogg_open(demuxer_t* demuxer) {
(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 @@ int demux_ogg_open(demuxer_t* demuxer) {
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 @@ int demux_ogg_open(demuxer_t* demuxer) {
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 @@ int demux_ogg_open(demuxer_t* demuxer) {
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 @@ int demux_ogg_open(demuxer_t* demuxer) {
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) {
diff --git a/libmpdemux/demux_real.c b/libmpdemux/demux_real.c
index 39dd5fb75c..6aae5c5f39 100644
--- a/libmpdemux/demux_real.c
+++ b/libmpdemux/demux_real.c
@@ -159,7 +159,7 @@ static void dump_index(demuxer_t *demuxer, int stream_id)
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 @@ static demuxer_t* demux_open_real(demuxer_t* demuxer)
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*/
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index b8b0a14ae9..282c6e97cf 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -340,7 +340,7 @@ int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds){
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
diff --git a/libmpdemux/http.c b/libmpdemux/http.c
index 3476db30d0..f5eb844312 100644
--- a/libmpdemux/http.c
+++ b/libmpdemux/http.c
@@ -735,7 +735,7 @@ static int http_streaming_start(stream_t *stream, int* file_format) {
}
stream->fd=fd;
- if( verbose>0 ) {
+ if( mp_msg_test(MSGT_NETWORK,MSGL_V) ) {
http_debug_hdr( http_hdr );
}
diff --git a/libmpdemux/stream.c b/libmpdemux/stream.c
index 869b3e1f62..0ea628a008 100644
--- a/libmpdemux/stream.c
+++ b/libmpdemux/stream.c
@@ -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_fill_buffer(stream_t *s){
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 @@ off_t newpos=0;
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);
}
diff --git a/libmpdemux/video.c b/libmpdemux/video.c
index 89415fe944..499bf4ab9a 100644
--- a/libmpdemux/video.c
+++ b/libmpdemux/video.c
@@ -285,7 +285,7 @@ mpeg_header_parser:
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;
}