# HG changeset patch # User uau # Date 1146136401 0 # Node ID 87161f96fa66b830ec9bc685d0f55a542ae8b237 # Parent ac7048fd7c8c3c801cb5f0a1bae71f58a849d57b Change common pts variables from floats to doubles. Individual demuxers should be changed later. diff -r ac7048fd7c8c -r 87161f96fa66 libmpdemux/demuxer.c --- 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){ diff -r ac7048fd7c8c -r 87161f96fa66 libmpdemux/demuxer.h --- 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); diff -r ac7048fd7c8c -r 87161f96fa66 libmpdemux/stheader.h --- 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 diff -r ac7048fd7c8c -r 87161f96fa66 mplayer.c --- 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;