-
- astream = player->GetStream(0, AviStream::Audio);
- vstream = player->GetStream(0, AviStream::Video);
+ printf("sound: %u samples (%f seconds)\n", astream->GetEndPos(),
+ astream->GetEndTime());
+ width = head.dwWidth;
+ height = head.dwHeight;
+ dwMicroSecPerFrame = head.dwMicroSecPerFrame;
+ samplesperframe = astream->GetEndPos()/astream->GetEndTime()*head.dwMicroSecPerFrame/1000000;
+ samplerate = (int)(astream->GetEndPos()/astream->GetEndTime());
+ fps = 1000000.0/dwMicroSecPerFrame;
+#else
+ StreamInfo*audioinfo;
+ StreamInfo*videoinfo;
+ audioinfo = astream->GetStreamInfo();
+ videoinfo = vstream->GetStreamInfo();
+ width = videoinfo->GetVideoWidth();
+ height = videoinfo->GetVideoHeight();
+ samplerate = audioinfo->GetAudioSamplesPerSec();
+ samplesperframe = audioinfo->GetAudioSamplesPerSec()/videoinfo->GetFps();
+ fps = (double)(videoinfo->GetFps());
+ delete(audioinfo);
+ delete(videoinfo);
+#endif