1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-28 19:30:44 +00:00

added stream_pts to demuxer_t and demux_packet_t to hold the time value reported by the stream layer

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21796 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nicodvb 2006-12-31 11:05:26 +00:00
parent 9eb302dee8
commit b5898c2aa6
2 changed files with 7 additions and 2 deletions

View File

@ -184,6 +184,7 @@ demuxer_t* new_demuxer(stream_t *stream,int type,int a_id,int v_id,int s_id,char
demuxer_t *d=malloc(sizeof(demuxer_t));
memset(d,0,sizeof(demuxer_t));
d->stream=stream;
d->stream_pts = MP_NOPTS_VALUE;
d->movi_start=stream->start_pos;
d->movi_end=stream->end_pos;
d->seekable=1;
@ -381,6 +382,7 @@ int ds_fill_buffer(demux_stream_t *ds){
ds->pts_bytes=0;
}
ds->pts_bytes+=p->len; // !!!
if(p->stream_pts != MP_NOPTS_VALUE) demux->stream_pts=p->stream_pts;
ds->flags=p->flags;
// unlink packet:
ds->bytes-=p->len;
@ -933,9 +935,9 @@ if(!demuxer->seekable){
if(flags & 1) // absolute seek
pts = 0.0f;
else {
if(stream_control(demuxer->stream, STREAM_CTRL_GET_CURRENT_TIME, &tmp) == STREAM_UNSUPORTED)
if(demuxer->stream_pts == MP_NOPTS_VALUE)
goto dmx_seek;
pts = tmp;
pts = demuxer->stream_pts;
}
if(flags & 2) { // percent seek

View File

@ -85,6 +85,7 @@
typedef struct demux_packet_st {
int len;
double pts;
double stream_pts;
off_t pos; // position in index (AVI) or file (MPG)
unsigned char* buffer;
int flags; // keyframe, etc
@ -176,6 +177,7 @@ typedef struct demuxer_st {
off_t movi_start;
off_t movi_end;
stream_t *stream;
double stream_pts; // current stream pts, if applicable (e.g. dvd)
char *filename; ///< Needed by avs_check_file
int synced; // stream synced (used by mpeg)
int type; // demuxer type: mpeg PS, mpeg ES, avi, avi-ni, avi-nini, asf
@ -210,6 +212,7 @@ inline static demux_packet_t* new_demux_packet(int len){
// still using 0 by default in case there is some code that uses 0 for both
// unknown and a valid pts value
dp->pts=correct_pts ? MP_NOPTS_VALUE : 0;
dp->stream_pts = MP_NOPTS_VALUE;
dp->pos=0;
dp->flags=0;
dp->refcount=1;