diff options
author | wm4 <wm4@mplayer2.org> | 2012-03-05 22:24:57 +0100 |
---|---|---|
committer | wm4 <wm4@mplayer2.org> | 2012-03-05 22:24:57 +0100 |
commit | 8dc0743571630a08fd40fa88aa09b12b4ce65bf2 (patch) | |
tree | e1c4465768635d77954b5fd21ae726444ee4f48a /mplayer.c | |
parent | aebdf4f153438497b9310bd1417b5216f07e043b (diff) | |
parent | afecdb681bed81b5df0ed18a300c68be603dfdf9 (diff) | |
download | mpv-8dc0743571630a08fd40fa88aa09b12b4ce65bf2.tar.bz2 mpv-8dc0743571630a08fd40fa88aa09b12b4ce65bf2.tar.xz |
Merge remote-tracking branch 'origin/master' into my_master
Conflicts:
mplayer.c
screenshot.c
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -22,6 +22,8 @@ #include <math.h> #include <assert.h> +#include <libavutil/intreadwrite.h> + #include "config.h" #include "talloc.h" @@ -64,8 +66,6 @@ #include "mplayer.h" #include "m_property.h" -#include "libavutil/avstring.h" - #include "sub/subreader.h" #include "sub/find_subfiles.h" #include "sub/dec_sub.h" @@ -76,7 +76,6 @@ #include "sub/font_load.h" #include "sub/sub.h" -#include "ffmpeg_files/intreadwrite.h" #include "sub/av_sub.h" #include "libmpcodecs/dec_teletext.h" #include "cpudetect.h" @@ -2813,7 +2812,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 @@ -2912,7 +2913,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; |