[Mplayer-cvslog] CVS: main/libmpdemux demux_avi.c,1.46,1.47
Arpi of Ize
arpi at mplayerhq.hu
Fri Oct 18 00:12:36 CEST 2002
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv32200
Modified Files:
demux_avi.c
Log Message:
fix & workaround possible sig8/sig11 in blocksize calculation
Index: demux_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_avi.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- demux_avi.c 25 Sep 2002 22:19:11 -0000 1.46
+++ demux_avi.c 17 Oct 2002 22:12:32 -0000 1.47
@@ -31,9 +31,17 @@
if(stream_id==demux->audio->id){
if(!demux->audio->sh){
- demux->audio->sh=demux->a_streams[stream_id];
+ sh_audio_t* sh;
+ sh=demux->audio->sh=demux->a_streams[stream_id];
mp_msg(MSGT_DEMUX,MSGL_V,"Auto-selected AVI audio ID = %d\n",demux->audio->id);
- demux->audio->block_size=((sh_audio_t*)(demux->audio->sh))->wf->nBlockAlign;
+ if(sh->wf){
+ demux->audio->block_size=sh->wf->nBlockAlign;
+ if(!demux->audio->block_size){
+ // for PCM audio we can calculate the blocksize:
+ if(sh->format==1) demux->audio->block_size=sh->wf->nChannels*(sh->wf->wBitsPerSample/8);
+ if(!demux->audio->block_size) demux->audio->block_size=1; // bug!
+ }
+ }
//printf("&&&&& setting blocksize to %d &&&&&\n",demux->audio->block_size);
}
return demux->audio;
More information about the MPlayer-cvslog
mailing list