[MPlayer-cvslog] CVS: main mencoder.c,1.284,1.285
Richard Felker CVS
syncmail at mplayerhq.hu
Tue May 24 04:41:50 CEST 2005
CVS change done by Richard Felker CVS
Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv13801
Modified Files:
mencoder.c
Log Message:
patch by oded to fix edl hang when end of audio is reached
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.284
retrieving revision 1.285
diff -u -r1.284 -r1.285
--- mencoder.c 22 May 2005 15:34:23 -0000 1.284
+++ mencoder.c 24 May 2005 02:41:48 -0000 1.285
@@ -1612,15 +1612,16 @@
if (sh_audio) {
a_pts = d_audio->pts + (ds_tell_pts(d_audio) - sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
while (sh_video->pts > a_pts) {
+ int len;
if (mux_a->h.dwSampleSize) {
- int len;
len = mux_a->wf->nAvgBytesPerSec * (sh_video->pts - a_pts);
len/= mux_a->h.dwSampleSize; if(len<1) len=1;
len*= mux_a->h.dwSampleSize;
- demux_read_data(sh_audio->ds,mux_a->buffer,len);
+ len = demux_read_data(sh_audio->ds,mux_a->buffer,len);
} else {
- ds_get_packet(sh_audio->ds,(unsigned char**) &mux_a->buffer);
+ len = ds_get_packet(sh_audio->ds,(unsigned char**) &mux_a->buffer);
}
+ if (len <= 0) break; // EOF of audio.
a_pts = d_audio->pts + (ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
}
}
More information about the MPlayer-cvslog
mailing list