[MPlayer-cvslog] r22516 - in trunk: libmpcodecs/dec_video.c mplayer.c

uau subversion at mplayerhq.hu
Sun Mar 11 18:30:44 CET 2007


Author: uau
Date: Sun Mar 11 18:30:44 2007
New Revision: 22516

Modified:
   trunk/libmpcodecs/dec_video.c
   trunk/mplayer.c

Log:
Allow demuxers to return packets with no pts in -correct-pts mode
as long as there are enough pts values for frames that the decoder
returns.
This should allow passing NAL units individually.


Modified: trunk/libmpcodecs/dec_video.c
==============================================================================
--- trunk/libmpcodecs/dec_video.c	(original)
+++ trunk/libmpcodecs/dec_video.c	Sun Mar 11 18:30:44 2007
@@ -337,7 +337,7 @@ void *decode_video(sh_video_t *sh_video,
     unsigned int t2;
     double tt;
 
-    if (correct_pts) {
+    if (correct_pts && pts != MP_NOPTS_VALUE) {
 	int delay = get_current_video_decoder_lag(sh_video);
 	if (delay >= 0) {
 	    if (delay > sh_video->num_buffered_pts)
@@ -395,8 +395,15 @@ void *decode_video(sh_video_t *sh_video,
 	mpi->fields &= ~MP_IMGFIELD_TOP_FIRST;
 
     if (correct_pts) {
-	sh_video->num_buffered_pts--;
-	sh_video->pts = sh_video->buffered_pts[sh_video->num_buffered_pts];
+	if (sh_video->num_buffered_pts) {
+	    sh_video->num_buffered_pts--;
+	    sh_video->pts = sh_video->buffered_pts[sh_video->num_buffered_pts];
+	}
+	else {
+	    mp_msg(MSGT_CPLAYER, MSGL_ERR, "No pts value from demuxer to "
+		   "use for frame!\n");
+	    sh_video->pts = MP_NOPTS_VALUE;
+	}
     }
     return mpi;
 }

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Sun Mar 11 18:30:44 2007
@@ -1615,8 +1615,6 @@ static int generate_video_frame(sh_video
 	}
 	if (in_size > max_framesize)
 	    max_framesize = in_size;
-	if (pts == MP_NOPTS_VALUE)
-	    mp_msg(MSGT_CPLAYER, MSGL_ERR, "pts value from demuxer MISSING\n");
 	current_module = "decode video";
 	decoded_frame = decode_video(sh_video, start, in_size, 0, pts);
 	if (decoded_frame) {



More information about the MPlayer-cvslog mailing list