diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-27 17:25:41 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-27 17:25:41 +0000 |
commit | a33158d60d04f21ee10881ccc5cd295e1aae5bca (patch) | |
tree | 021a6f021ecf99a2deebe6d17cb1574dc97673a5 /libmpdemux | |
parent | e2c173be10fa87ef6df3049d80fcca80a2d1a174 (diff) | |
download | mpv-a33158d60d04f21ee10881ccc5cd295e1aae5bca.tar.bz2 mpv-a33158d60d04f21ee10881ccc5cd295e1aae5bca.tar.xz |
Convert printfs in aviprint.c to mp_msg and give the information printing
functions in this file a verbosity_level parameter.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17978 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/asfheader.c | 8 | ||||
-rw-r--r-- | libmpdemux/aviheader.c | 38 | ||||
-rw-r--r-- | libmpdemux/aviprint.c | 168 | ||||
-rw-r--r-- | libmpdemux/demux_audio.c | 4 | ||||
-rw-r--r-- | libmpdemux/demux_lavf.c | 8 | ||||
-rw-r--r-- | libmpdemux/demux_ogg.c | 18 | ||||
-rw-r--r-- | libmpdemux/demux_real.c | 4 | ||||
-rw-r--r-- | libmpdemux/demux_realaud.c | 4 |
8 files changed, 126 insertions, 126 deletions
diff --git a/libmpdemux/asfheader.c b/libmpdemux/asfheader.c index 72179bd445..70b4fd98de 100644 --- a/libmpdemux/asfheader.c +++ b/libmpdemux/asfheader.c @@ -137,8 +137,8 @@ int asf_check_header(demuxer_t *demuxer){ 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 @@ 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( 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 @@ 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( 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; diff --git a/libmpdemux/aviheader.c b/libmpdemux/aviheader.c index e360149dfe..592d71ffdb 100644 --- a/libmpdemux/aviheader.c +++ b/libmpdemux/aviheader.c @@ -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 @@ 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( 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 @@ while(1){ 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 @@ while(1){ 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 @@ 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( 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 @@ while(1){ 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 @@ while(1){ 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 @@ while(1){ 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 @@ if (priv->isodml && (index_mode==-1 || index_mode==0 || index_mode==1)) { } 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 (priv->isodml && (index_mode==-1 || index_mode==0 || index_mode==1)) { } } - 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 @@ skip_chunk: } 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) { diff --git a/libmpdemux/aviprint.c b/libmpdemux/aviprint.c index fe89f94a84..c23af4bf19 100644 --- a/libmpdemux/aviprint.c +++ b/libmpdemux/aviprint.c @@ -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_flags(MainAVIHeader *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); - 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 @@ void print_index(AVIINDEXENTRY *idx,int idx_size){ 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_index(AVIINDEXENTRY *idx,int idx_size){ } } -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"); } diff --git a/libmpdemux/demux_audio.c b/libmpdemux/demux_audio.c index 880677bf5f..e6457228b7 100644 --- a/libmpdemux/demux_audio.c +++ b/libmpdemux/demux_audio.c @@ -44,7 +44,7 @@ typedef struct mp3_hdr { } 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 @@ static int demux_audio_open(demuxer_t* demuxer) { } } - 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 diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index 057f4e315d..e2565f5dc7 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -46,8 +46,8 @@ typedef struct lavf_priv_t{ 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 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){ 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 @@ 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( 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; diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c index 76f97b41f0..0e686a8419 100644 --- a/libmpdemux/demux_ogg.c +++ b/libmpdemux/demux_ogg.c @@ -705,8 +705,8 @@ void demux_ogg_scan_stream(demuxer_t* demuxer) { } -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 demux_ogg_open(demuxer_t* demuxer) { (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 @@ 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( 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 @@ 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( 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 @@ 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( 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 @@ 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( 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 @@ int demux_ogg_open(demuxer_t* demuxer) { // 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 @@ int demux_ogg_open(demuxer_t* demuxer) { /// 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; diff --git a/libmpdemux/demux_real.c b/libmpdemux/demux_real.c index 6aae5c5f39..9cdd041caf 100644 --- a/libmpdemux/demux_real.c +++ b/libmpdemux/demux_real.c @@ -1070,7 +1070,7 @@ discard: }// 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 @@ static demuxer_t* demux_open_real(demuxer_t* demuxer) 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) || diff --git a/libmpdemux/demux_realaud.c b/libmpdemux/demux_realaud.c index 1346e34bc2..f5d085ffce 100644 --- a/libmpdemux/demux_realaud.c +++ b/libmpdemux/demux_realaud.c @@ -144,7 +144,7 @@ static int demux_ra_fill_buffer(demuxer_t *demuxer, demux_stream_t *dsds) -extern void print_wave_header(WAVEFORMATEX *h); +extern void print_wave_header(WAVEFORMATEX *h, int verbose_level); @@ -313,7 +313,7 @@ static demuxer_t* demux_open_ra(demuxer_t* demuxer) 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; |