Mercurial > mplayer.hg
comparison libmpcodecs/dec_video.c @ 31972:96559880e475
Improve A/V sync when not using -correct-pts.
This fixes at least playing PAFF streams with the native ts demuxer.
(Breaks the non-standard -demuxer lavf -nocorrect-pts.)
Patch by P«”sztor Szil«”rd, bartosteka freemail hu
author | cehoyos |
---|---|
date | Tue, 07 Sep 2010 16:20:52 +0000 |
parents | 2b390c08ed07 |
children | e648473842bd |
comparison
equal
deleted
inserted
replaced
31971:910579aafc61 | 31972:96559880e475 |
---|---|
386 sh_video->codec->name, sh_video->codec->drv, sh_video->codec->info); | 386 sh_video->codec->name, sh_video->codec->drv, sh_video->codec->info); |
387 return 1; // success | 387 return 1; // success |
388 } | 388 } |
389 | 389 |
390 void *decode_video(sh_video_t *sh_video, unsigned char *start, int in_size, | 390 void *decode_video(sh_video_t *sh_video, unsigned char *start, int in_size, |
391 int drop_frame, double pts) | 391 int drop_frame, double pts, int *full_frame) |
392 { | 392 { |
393 mp_image_t *mpi = NULL; | 393 mp_image_t *mpi = NULL; |
394 unsigned int t = GetTimer(); | 394 unsigned int t = GetTimer(); |
395 unsigned int t2; | 395 unsigned int t2; |
396 double tt; | 396 double tt; |
403 | 403 |
404 if (mpi && mpi->type == MP_IMGTYPE_INCOMPLETE) { | 404 if (mpi && mpi->type == MP_IMGTYPE_INCOMPLETE) { |
405 got_picture = 0; | 405 got_picture = 0; |
406 mpi = NULL; | 406 mpi = NULL; |
407 } | 407 } |
408 | |
409 if (full_frame) | |
410 *full_frame = got_picture; | |
408 | 411 |
409 delay = get_current_video_decoder_lag(sh_video); | 412 delay = get_current_video_decoder_lag(sh_video); |
410 if (correct_pts && pts != MP_NOPTS_VALUE | 413 if (correct_pts && pts != MP_NOPTS_VALUE |
411 && (got_picture || sh_video->num_buffered_pts < delay)) { | 414 && (got_picture || sh_video->num_buffered_pts < delay)) { |
412 if (sh_video->num_buffered_pts == | 415 if (sh_video->num_buffered_pts == |