diff options
author | 2001-08-23 21:10:31 +0000 | |
---|---|---|
committer | 2001-08-23 21:10:31 +0000 | |
commit | e5af8d5eef816794b4d3a1b774f3e2b21480e055 (patch) | |
tree | 54e2ff9e6d8592fe56b26e20aa5a779f161f7b5f /aviheader.c | |
parent | e6ce5a498f2380f744ef26654553127b7de21582 (diff) |
print AVI info block (copyright,artist etc) (-v only)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1672 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'aviheader.c')
-rw-r--r-- | aviheader.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/aviheader.c b/aviheader.c index 05338ccdb8..af6b5140a9 100644 --- a/aviheader.c +++ b/aviheader.c @@ -44,13 +44,14 @@ while(1){ int id=stream_read_dword_le(demuxer->stream); int chunksize,size2; static int last_fccType=0; + char* hdr=NULL; // if(stream_eof(demuxer->stream)) break; // if(id==mmioFOURCC('L','I','S','T')){ int len=stream_read_dword_le(demuxer->stream)-4; // list size id=stream_read_dword_le(demuxer->stream); // list type - mp_dbg(MSGT_HEADER,MSGL_DBG2,"LIST %.4s len=%d\n",(char *) &id,len); + mp_msg(MSGT_HEADER,MSGL_DBG2,"LIST %.4s len=%d\n",(char *) &id,len); if(id==listtypeAVIMOVIE){ // found MOVI header demuxer->movi_start=stream_tell(demuxer->stream); @@ -63,9 +64,15 @@ while(1){ continue; } size2=stream_read_dword_le(demuxer->stream); - mp_dbg(MSGT_HEADER,MSGL_DBG2,"CHUNK %.4s len=%d\n",(char *) &id,size2); + mp_msg(MSGT_HEADER,MSGL_DBG2,"CHUNK %.4s len=%d\n",(char *) &id,size2); chunksize=(size2+1)&(~1); switch(id){ + case mmioFOURCC('I','S','F','T'): hdr="Software";break; + case mmioFOURCC('I','N','A','M'): hdr="Name";break; + case mmioFOURCC('I','S','B','J'): hdr="Subject";break; + case mmioFOURCC('I','A','R','T'): hdr="Artist";break; + case mmioFOURCC('I','C','O','P'): hdr="Copyright";break; + case mmioFOURCC('I','C','M','T'): hdr="Comment";break; case ckidAVIMAINHDR: // read 'avih' stream_read(demuxer->stream,(char*) &avih,MIN(size2,sizeof(avih))); le2me_MainAVIHeader(&avih); // swap to machine endian @@ -152,6 +159,14 @@ while(1){ break; } } + if(hdr){ + char buf[256]; + int len=(size2<250)?size2:250; + stream_read(demuxer->stream,buf,len); + chunksize-=len; + buf[len]=0; + mp_msg(MSGT_HEADER,MSGL_V,"%-10s: %s\n",hdr,buf); + } if(chunksize>0) stream_skip(demuxer->stream,chunksize); else if(chunksize<0) mp_msg(MSGT_HEADER,MSGL_WARN,"chunksize=%d (id=%.4s)\n",chunksize,(char *) &id); |