summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-03 22:10:44 +0200
committerwm4 <wm4@nowhere>2015-10-03 22:10:44 +0200
commit3ccac74de22bc79e3a228b52ffcb5bbb927772dd (patch)
tree10bab4396e1de745d51907febbe3a3555abbcec3 /video/decode
parentee283843fab8b07d7a6e00e70efbb27a46e8a40d (diff)
downloadmpv-3ccac74de22bc79e3a228b52ffcb5bbb927772dd.tar.bz2
mpv-3ccac74de22bc79e3a228b52ffcb5bbb927772dd.tar.xz
video: remove codec delay estimation
This was used only by the timestamp sorting code, which is a fallback for avi files (as well as avi-muxed mkv files). This was supposed to prevent accumulating timestamps in case the decoder consumes more packets than it outputs frames (i.e. frames are dropped). This didn't work very well (timestamps could be off by a large amount), the estimation of the delay was fragile, and the interdependencies with the decoder were annoying, so kill it.
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/dec_video.c9
-rw-r--r--video/decode/vd.h1
-rw-r--r--video/decode/vd_lavc.c7
3 files changed, 2 insertions, 15 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c
index c7b0866f20..6752782645 100644
--- a/video/decode/dec_video.c
+++ b/video/decode/dec_video.c
@@ -213,14 +213,9 @@ bool video_init_best_codec(struct dec_video *d_video, char* video_decoders)
static void add_pts_to_sort(struct dec_video *d_video, double pts)
{
if (pts != MP_NOPTS_VALUE) {
- int delay = -1;
- video_vd_control(d_video, VDCTRL_QUERY_UNSEEN_FRAMES, &delay);
- if (delay >= 0 && delay < d_video->num_buffered_pts)
- d_video->num_buffered_pts = delay;
- if (d_video->num_buffered_pts ==
- sizeof(d_video->buffered_pts) / sizeof(double))
+ if (d_video->num_buffered_pts == MP_ARRAY_SIZE(d_video->buffered_pts)) {
MP_ERR(d_video, "Too many buffered pts\n");
- else {
+ } else {
int i, j;
for (i = 0; i < d_video->num_buffered_pts; i++)
if (d_video->buffered_pts[i] < pts)
diff --git a/video/decode/vd.h b/video/decode/vd.h
index 6f5016ac37..2c812dd4e1 100644
--- a/video/decode/vd.h
+++ b/video/decode/vd.h
@@ -42,7 +42,6 @@ extern const vd_functions_t *const mpcodecs_vd_drivers[];
enum vd_ctrl {
VDCTRL_RESET = 1, // reset decode state after seeking
- VDCTRL_QUERY_UNSEEN_FRAMES, // current decoder lag
VDCTRL_FORCE_HWDEC_FALLBACK, // force software decoding fallback
VDCTRL_GET_HWDEC,
};
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index e5ce92addb..9cc73d033a 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -689,13 +689,6 @@ static int control(struct dec_video *vd, int cmd, void *arg)
case VDCTRL_RESET:
avcodec_flush_buffers(avctx);
return CONTROL_TRUE;
- case VDCTRL_QUERY_UNSEEN_FRAMES:;
- int delay = avctx->has_b_frames;
- assert(delay >= 0);
- if (avctx->active_thread_type & FF_THREAD_FRAME)
- delay += avctx->thread_count - 1;
- *(int *)arg = delay;
- return CONTROL_TRUE;
case VDCTRL_GET_HWDEC: {
int hwdec = ctx->hwdec ? ctx->hwdec->type : 0;
if (!ctx->software_fallback_decoder)