diff options
author | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-04-15 14:33:49 +0000 |
---|---|---|
committer | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-04-15 14:33:49 +0000 |
commit | 415c45924b85bd3e733dbb87393bd1a425eadd4a (patch) | |
tree | 0dc6b4d31ea8d0b7fcff807d56292815c15dfbc2 /aviheader.c | |
parent | 89e6a6f68e023823017b424df936d7086faa96d6 (diff) |
sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@433 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'aviheader.c')
-rw-r--r-- | aviheader.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/aviheader.c b/aviheader.c index f3c1f69776..9154c2f31c 100644 --- a/aviheader.c +++ b/aviheader.c @@ -56,18 +56,20 @@ while(1){ break; } case ckidSTREAMFORMAT: { // read 'strf' if(last_fccType==streamtypeVIDEO){ - stream_read(demuxer->stream,(char*) &sh_video->bih,MIN(size2,sizeof(sh_video->bih))); - chunksize-=MIN(size2,sizeof(sh_video->bih)); - 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; + sh_video->bih=malloc(chunksize); memset(sh_video->bih,0,chunksize); + if(verbose>=2) printf("found 'bih', %d bytes of %d\n",chunksize,sizeof(BITMAPINFOHEADER)); + stream_read(demuxer->stream,(char*) sh_video->bih,chunksize); + 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; // if(demuxer->video->id==-1) demuxer->video->id=stream_id; } else if(last_fccType==streamtypeAUDIO){ - int z=(chunksize<64)?chunksize:64; + sh_audio->wf=malloc(chunksize); memset(sh_audio->wf,0,chunksize); if(verbose>=2) printf("found 'wf', %d bytes of %d\n",chunksize,sizeof(WAVEFORMATEX)); - stream_read(demuxer->stream,(char*) &sh_audio->wf,z); - chunksize-=z; - if(verbose>=1) print_wave_header(&sh_audio->wf); + stream_read(demuxer->stream,(char*) sh_audio->wf,chunksize); + chunksize=0; + if(verbose>=1) print_wave_header(sh_audio->wf); // if(demuxer->audio->id==-1) demuxer->audio->id=stream_id; } break; |