Mercurial > mplayer.hg
changeset 18309:87161f96fa66
Change common pts variables from floats to doubles. Individual demuxers
should be changed later.
author | uau |
---|---|
date | Thu, 27 Apr 2006 11:13:21 +0000 |
parents | ac7048fd7c8c |
children | dcfd45170912 |
files | libmpdemux/demuxer.c libmpdemux/demuxer.h libmpdemux/stheader.h mplayer.c |
diffstat | 4 files changed, 13 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demuxer.c Thu Apr 27 08:44:04 2006 +0000 +++ b/libmpdemux/demuxer.c Thu Apr 27 11:13:21 2006 +0000 @@ -314,7 +314,7 @@ dp->len,dp->pts,(unsigned int)dp->pos,ds->demuxer->audio->packs,ds->demuxer->video->packs); } -void ds_read_packet(demux_stream_t *ds,stream_t *stream,int len,float pts,off_t pos,int flags){ +void ds_read_packet(demux_stream_t *ds, stream_t *stream, int len, double pts, off_t pos, int flags) { demux_packet_t* dp=new_demux_packet(len); len = stream_read(stream,dp->buffer,len); resize_demux_packet(dp, len); @@ -538,7 +538,8 @@ } } -float ds_get_next_pts(demux_stream_t *ds) { +double ds_get_next_pts(demux_stream_t *ds) +{ demuxer_t* demux = ds->demuxer; while(!ds->first) { if(demux->audio->packs>=MAX_PACKS || demux->audio->bytes>=MAX_PACK_BYTES){
--- a/libmpdemux/demuxer.h Thu Apr 27 08:44:04 2006 +0000 +++ b/libmpdemux/demuxer.h Thu Apr 27 11:13:21 2006 +0000 @@ -76,7 +76,7 @@ // Holds one packet/frame/whatever typedef struct demux_packet_st { int len; - float pts; + double pts; off_t pos; // position in index (AVI) or file (MPG) unsigned char* buffer; int flags; // keyframe, etc @@ -89,7 +89,7 @@ int buffer_pos; // current buffer position int buffer_size; // current buffer size unsigned char* buffer; // current buffer, never free() it, always use free_demux_packet(buffer_ref); - float pts; // current buffer's pts + double pts; // current buffer's pts int pts_bytes; // number of bytes read after last pts stamp int eof; // end of demuxed stream? (true if all buffer empty) off_t pos; // position in the input stream (file) @@ -244,7 +244,7 @@ void free_demuxer(demuxer_t *demuxer); 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); +void ds_read_packet(demux_stream_t *ds, stream_t *stream, int len, double pts, off_t pos, int flags); int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds); int ds_fill_buffer(demux_stream_t *ds); @@ -286,7 +286,7 @@ int ds_get_packet(demux_stream_t *ds,unsigned char **start); int ds_get_packet_pts(demux_stream_t *ds, unsigned char **start, double *pts); int ds_get_packet_sub(demux_stream_t *ds,unsigned char **start); -float ds_get_next_pts(demux_stream_t *ds); +double ds_get_next_pts(demux_stream_t *ds); // This is defined here because demux_stream_t ins't defined in stream.h stream_t* new_ds_stream(demux_stream_t *ds);
--- a/libmpdemux/stheader.h Thu Apr 27 08:44:04 2006 +0000 +++ b/libmpdemux/stheader.h Thu Apr 27 11:13:21 2006 +0000 @@ -11,7 +11,7 @@ struct codecs_st *codec; unsigned int format; int inited; - float delay; // relative (to sh_video->timer) time in audio stream + double delay; // relative (to sh_video->timer) time in audio stream float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar) // output format: int sample_format; @@ -62,8 +62,8 @@ float num_frames; // number of frames played int num_frames_decoded; // number of frames decoded // timing (mostly for mpeg): - float pts; // predicted/interpolated PTS of the current frame - float i_pts; // PTS for the _next_ I/P frame + double pts; // predicted/interpolated PTS of the current frame + double i_pts; // PTS for the _next_ I/P frame // output format: (set by demuxer) float fps; // frames per second (set only if constant fps) float frametime; // 1/fps
--- a/mplayer.c Thu Apr 27 08:44:04 2006 +0000 +++ b/mplayer.c Thu Apr 27 11:13:21 2006 +0000 @@ -3684,7 +3684,7 @@ if(playsize>0){ sh_audio->a_out_buffer_len-=playsize; memmove(sh_audio->a_out_buffer,&sh_audio->a_out_buffer[playsize],sh_audio->a_out_buffer_len); - sh_audio->delay+=playback_speed*playsize/(float)ao_data.bps; + sh_audio->delay+=playback_speed*playsize/(double)ao_data.bps; } break; @@ -3937,8 +3937,8 @@ current_module="av_sync"; if(sh_audio){ - float a_pts=0; - float v_pts=0; + double a_pts=0; + double v_pts=0; // unplayed bytes in our and soundcard/dma buffer: float delay=playback_speed*audio_out->get_delay()+(float)sh_audio->a_buffer_len/(float)sh_audio->o_bps;