summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-10 10:32:23 +0200
committerwm4 <wm4@nowhere>2014-05-10 10:44:16 +0200
commitfc385baf021921d478e23f5a12c5e0d9f27e5368 (patch)
tree1167ec7a421448d4ba00efb64c309cf2a9ecf144 /video/out
parentbc9a86c3923ce6d293db45100e5314d9c5241e12 (diff)
downloadmpv-fc385baf021921d478e23f5a12c5e0d9f27e5368.tar.bz2
mpv-fc385baf021921d478e23f5a12c5e0d9f27e5368.tar.xz
encode: fix PTS unit mismatch
This used MP_NOPTS_VALUE to compare with ffmpeg-style int64_t PTS values. This probably happened to work, because both constants use the same value.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_lavc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index 0e9ead3b3b..ed23a27066 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -134,9 +134,9 @@ static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
goto error;
}
- vc->lastipts = MP_NOPTS_VALUE;
- vc->lastframeipts = MP_NOPTS_VALUE;
- vc->lastencodedipts = MP_NOPTS_VALUE;
+ vc->lastipts = AV_NOPTS_VALUE;
+ vc->lastframeipts = AV_NOPTS_VALUE;
+ vc->lastencodedipts = AV_NOPTS_VALUE;
if (pix_fmt == AV_PIX_FMT_NONE) {
MP_FATAL(vo, "Format %s not supported by lavc.\n",
@@ -407,7 +407,7 @@ static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi)
}
}
- if (vc->lastipts != MP_NOPTS_VALUE) {
+ if (vc->lastipts != AV_NOPTS_VALUE) {
// we have a valid image in lastimg
while (vc->lastipts < frameipts) {
@@ -417,7 +417,7 @@ static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi)
// we will ONLY encode this frame if it can be encoded at at least
// vc->mindeltapts after the last encoded frame!
int64_t skipframes =
- (vc->lastencodedipts == MP_NOPTS_VALUE)
+ (vc->lastencodedipts == AV_NOPTS_VALUE)
? 0
: vc->lastencodedipts + vc->mindeltapts - vc->lastipts;
if (skipframes < 0)
@@ -464,7 +464,7 @@ static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi)
} while (size > 0);
} else {
if (frameipts >= vc->lastframeipts) {
- if (vc->lastframeipts != MP_NOPTS_VALUE && vc->lastdisplaycount != 1)
+ if (vc->lastframeipts != AV_NOPTS_VALUE && vc->lastdisplaycount != 1)
MP_INFO(vo, "Frame at pts %d got displayed %d times\n",
(int) vc->lastframeipts, vc->lastdisplaycount);
mp_image_setrefp(&vc->lastimg, mpi);