Change common pts variables from floats to doubles. Individual demuxers

should be changed later.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18310 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
uau 2006-04-27 11:13:21 +00:00
parent 4926e5f698
commit c843190441
4 changed files with 13 additions and 12 deletions

View File

@ -314,7 +314,7 @@ void ds_add_packet(demux_stream_t *ds,demux_packet_t* dp){
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 @@ 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)
{
demuxer_t* demux = ds->demuxer;
while(!ds->first) {
if(demux->audio->packs>=MAX_PACKS || demux->audio->bytes>=MAX_PACK_BYTES){

View File

@ -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 @@ typedef struct {
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_stream(demux_stream_t *ds);
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 @@ void ds_free_packs(demux_stream_t *ds);
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);

View File

@ -11,7 +11,7 @@ typedef struct {
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 @@ typedef struct {
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

View File

@ -3684,7 +3684,7 @@ while(sh_audio){
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 @@ if(time_frame>0.001 && !(vo_flags&256)){
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;