diff options
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -2804,7 +2804,9 @@ static double update_video_nocorrect_pts(struct MPContext *mpctx) frame_time = sh_video->next_frame_time; if (mpctx->restart_playback) frame_time = 0; - int in_size = video_read_frame(sh_video, &sh_video->next_frame_time, + int in_size = 0; + while (!in_size) + in_size = video_read_frame(sh_video, &sh_video->next_frame_time, &packet, force_fps); if (in_size < 0) { #ifdef CONFIG_DVDNAV @@ -2903,7 +2905,15 @@ static double update_video(struct MPContext *mpctx) int in_size = 0; unsigned char *buf = NULL; pts = MP_NOPTS_VALUE; - struct demux_packet *pkt = ds_get_packet2(mpctx->d_video, false); + struct demux_packet *pkt; + while (1) { + pkt = ds_get_packet2(mpctx->d_video, false); + if (!pkt || pkt->len) + break; + /* Packets with size 0 are assumed to not correspond to frames, + * but to indicate the absence of a frame in formats like AVI + * that must have packets at fixed timecode intervals. */ + } if (pkt) { in_size = pkt->len; buf = pkt->buffer; |