From 415c45924b85bd3e733dbb87393bd1a425eadd4a Mon Sep 17 00:00:00 2001 From: arpi_esp Date: Sun, 15 Apr 2001 14:33:49 +0000 Subject: 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 --- aviheader.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'aviheader.c') 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; -- cgit v1.2.3