summaryrefslogtreecommitdiffstats
path: root/aviheader.c
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-15 03:40:37 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-15 03:40:37 +0000
commit2ba092874905669f0f8e8fda1b043c73e50db716 (patch)
treef6fb6813964153e16bad3a110c330a3f57ca7f5f /aviheader.c
parent4eca33639f3d69767e15c92b35fc7387453ae126 (diff)
downloadmpv-2ba092874905669f0f8e8fda1b043c73e50db716.tar.bz2
mpv-2ba092874905669f0f8e8fda1b043c73e50db716.tar.xz
new stream selection code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@427 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'aviheader.c')
-rw-r--r--aviheader.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/aviheader.c b/aviheader.c
index 215fbc1bce..f3c1f69776 100644
--- a/aviheader.c
+++ b/aviheader.c
@@ -2,7 +2,8 @@
#define MIN(a,b) (((a)<(b))?(a):(b))
void read_avi_header(int no_index){
-
+sh_audio_t *sh_audio=NULL;
+sh_video_t *sh_video=NULL;
int stream_id=-1;
//---- AVI header:
@@ -41,29 +42,33 @@ while(1){
AVIStreamHeader h;
stream_read(demuxer->stream,(char*) &h,MIN(size2,sizeof(h)));
chunksize-=MIN(size2,sizeof(h));
- if(h.fccType==streamtypeVIDEO) memcpy(&sh_video_i.video,&h,sizeof(h));else
- if(h.fccType==streamtypeAUDIO) memcpy(&sh_audio_i.audio,&h,sizeof(h));
+ ++stream_id;
+ if(h.fccType==streamtypeVIDEO){
+ sh_video=new_sh_video(stream_id);
+ memcpy(&sh_video->video,&h,sizeof(h));
+ } else
+ if(h.fccType==streamtypeAUDIO){
+ sh_audio=new_sh_audio(stream_id);
+ memcpy(&sh_audio->audio,&h,sizeof(h));
+ }
last_fccType=h.fccType;
if(verbose>=1) print_strh(&h);
- ++stream_id;
break; }
case ckidSTREAMFORMAT: { // read 'strf'
if(last_fccType==streamtypeVIDEO){
- sh_video_t *sh_video=&sh_video_i; // FIXME!
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;
- if(demuxer->video->id==-1) demuxer->video->id=stream_id;
+// if(demuxer->video->id==-1) demuxer->video->id=stream_id;
} else
if(last_fccType==streamtypeAUDIO){
- sh_audio_t *sh_audio=&sh_audio_i; // FIXME!
int z=(chunksize<64)?chunksize:64;
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);
- if(demuxer->audio->id==-1) demuxer->audio->id=stream_id;
+// if(demuxer->audio->id==-1) demuxer->audio->id=stream_id;
}
break;
}