1
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 07:33:46 +01:00

Fixed 'reading after EOF'. demuxers didn't check, how many they've read!

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10892 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
lumag 2003-09-20 12:50:25 +00:00
parent 3633450622
commit 175884718b
3 changed files with 6 additions and 3 deletions

View File

@ -265,7 +265,8 @@ int demux_audio_fill_buffer(demux_stream_t *ds) {
case WAV : {
int l = sh_audio->wf->nAvgBytesPerSec;
demux_packet_t* dp = new_demux_packet(l);
stream_read(s,dp->buffer,l);
l = stream_read(s,dp->buffer,l);
resize_demux_packet(dp, l);
priv->last_pts = priv->last_pts < 0 ? 0 : priv->last_pts + l/(float)sh_audio->i_bps;
ds->pts = priv->last_pts - (ds_tell_pts(demux->audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
ds_add_packet(ds,dp);

View File

@ -68,7 +68,8 @@ int demux_rawaudio_fill_buffer(demuxer_t* demuxer, demux_stream_t *ds) {
dp->pts = (spos - demuxer->movi_start) / (float)(sh_audio->wf->nAvgBytesPerSec);
dp->pos = (spos - demuxer->movi_start);
stream_read(demuxer->stream,dp->buffer,l);
l = stream_read(demuxer->stream,dp->buffer,l);
resize_demux_packet(dp, l);
ds_add_packet(ds,dp);
return 1;

View File

@ -265,7 +265,8 @@ void ds_add_packet(demux_stream_t *ds,demux_packet_t* dp){
void ds_read_packet(demux_stream_t *ds,stream_t *stream,int len,float pts,off_t pos,int flags){
demux_packet_t* dp=new_demux_packet(len);
stream_read(stream,dp->buffer,len);
len = stream_read(stream,dp->buffer,len);
resize_demux_packet(dp, len);
dp->pts=pts; //(float)pts/90000.0f;
dp->pos=pos;
dp->flags=flags;