diff options
author | uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-03-11 17:30:44 +0000 |
---|---|---|
committer | uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-03-11 17:30:44 +0000 |
commit | a4c58e8f87aa0606f883876d8557dbc99016ebaa (patch) | |
tree | 7c04ae3e7c14bfc9dfaec78115fa141632a92080 | |
parent | e2e3c839e7e2f99e6f9571a8cf416f6b9d81665c (diff) |
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.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22516 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpcodecs/dec_video.c | 13 | ||||
-rw-r--r-- | mplayer.c | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index f366a54c57..c8b8bc972e 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -337,7 +337,7 @@ void *decode_video(sh_video_t *sh_video, unsigned char *start, int in_size, 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, unsigned char *start, int in_size, 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; } @@ -1615,8 +1615,6 @@ static int generate_video_frame(sh_video_t *sh_video, demux_stream_t *d_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) { |