[MPlayer-cvslog] r21827 - in trunk/libmpdemux: demuxer.c video.c
reimar
subversion at mplayerhq.hu
Fri Jan 5 16:24:39 CET 2007
Author: reimar
Date: Fri Jan 5 16:24:38 2007
New Revision: 21827
Modified:
trunk/libmpdemux/demuxer.c
trunk/libmpdemux/video.c
Log:
Make ds_get_next_pts return MP_NOPTS_VALUE instead of -1 on error,
-1 could be a perfectly valid pts.
Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c (original)
+++ trunk/libmpdemux/demuxer.c Fri Jan 5 16:24:38 2007
@@ -567,15 +567,15 @@
if(demux->audio->packs>=MAX_PACKS || demux->audio->bytes>=MAX_PACK_BYTES){
mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_TooManyAudioInBuffer,demux->audio->packs,demux->audio->bytes);
mp_msg(MSGT_DEMUXER,MSGL_HINT,MSGTR_MaybeNI);
- return -1;
+ return MP_NOPTS_VALUE;
}
if(demux->video->packs>=MAX_PACKS || demux->video->bytes>=MAX_PACK_BYTES){
mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_TooManyVideoInBuffer,demux->video->packs,demux->video->bytes);
mp_msg(MSGT_DEMUXER,MSGL_HINT,MSGTR_MaybeNI);
- return -1;
+ return MP_NOPTS_VALUE;
}
if(!demux_fill_buffer(demux,ds))
- return -1;
+ return MP_NOPTS_VALUE;
}
return ds->first->pts;
}
Modified: trunk/libmpdemux/video.c
==============================================================================
--- trunk/libmpdemux/video.c (original)
+++ trunk/libmpdemux/video.c Fri Jan 5 16:24:38 2007
@@ -581,8 +581,8 @@
case DEMUXER_TYPE_VIVO:
case DEMUXER_TYPE_OGG:
case DEMUXER_TYPE_ASF: {
- float next_pts = ds_get_next_pts(d_video);
- float d= next_pts > 0 ? next_pts - d_video->pts : d_video->pts-pts1;
+ double next_pts = ds_get_next_pts(d_video);
+ double d= (next_pts != MP_NOPTS_VALUE) ? next_pts - d_video->pts : d_video->pts-pts1;
if(d>=0){
if(d>0){
if((int)sh_video->fps==1000)
@@ -599,8 +599,8 @@
break;
case DEMUXER_TYPE_LAVF:
if((int)sh_video->fps==1000 || (int)sh_video->fps<=1){
- float next_pts = ds_get_next_pts(d_video);
- float d= next_pts > 0 ? next_pts - d_video->pts : d_video->pts-pts1;
+ double next_pts = ds_get_next_pts(d_video);
+ double d= (next_pts != MP_NOPTS_VALUE) ? next_pts - d_video->pts : d_video->pts-pts1;
if(d>=0){
frame_time = d;
}
@@ -609,7 +609,7 @@
case DEMUXER_TYPE_REAL:
{
double next_pts = ds_get_next_pts(d_video);
- float d = next_pts > 0 ? next_pts - d_video->pts : d_video->pts - pts1;
+ double d = (next_pts != MP_NOPTS_VALUE) ? next_pts - d_video->pts : d_video->pts - pts1;
frame_time = (d >= 0 && pts1 > 0) ? d : 0.001;
}
More information about the MPlayer-cvslog
mailing list