diff options
author | wm4 <wm4@nowhere> | 2014-05-10 10:32:23 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-05-10 10:44:16 +0200 |
commit | fc385baf021921d478e23f5a12c5e0d9f27e5368 (patch) | |
tree | 1167ec7a421448d4ba00efb64c309cf2a9ecf144 /audio | |
parent | bc9a86c3923ce6d293db45100e5314d9c5241e12 (diff) | |
download | mpv-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 'audio')
-rw-r--r-- | audio/out/ao_lavc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/audio/out/ao_lavc.c b/audio/out/ao_lavc.c index a72e389ac9..0bfe2eb9cb 100644 --- a/audio/out/ao_lavc.c +++ b/audio/out/ao_lavc.c @@ -166,8 +166,8 @@ static int init(struct ao *ao) // but at least one! ac->framecount = FFMAX(ac->framecount, 1); - ac->savepts = MP_NOPTS_VALUE; - ac->lastpts = MP_NOPTS_VALUE; + ac->savepts = AV_NOPTS_VALUE; + ac->lastpts = AV_NOPTS_VALUE; ao->untimed = true; @@ -251,7 +251,7 @@ static int encode(struct ao *ao, double apts, void **data) } int64_t frame_pts = av_rescale_q(frame->pts, ac->stream->codec->time_base, ac->worst_time_base); - if (ac->lastpts != MP_NOPTS_VALUE && frame_pts <= ac->lastpts) { + if (ac->lastpts != AV_NOPTS_VALUE && frame_pts <= ac->lastpts) { // this indicates broken video // (video pts failing to increase fast enough to match audio) MP_WARN(ao, "audio frame pts went backwards (%d <- %d), autofixed\n", @@ -265,7 +265,7 @@ static int encode(struct ao *ao, double apts, void **data) status = avcodec_encode_audio2(ac->stream->codec, &packet, frame, &gotpacket); if (!status) { - if (ac->savepts == MP_NOPTS_VALUE) + if (ac->savepts == AV_NOPTS_VALUE) ac->savepts = frame->pts; } @@ -310,7 +310,7 @@ static int encode(struct ao *ao, double apts, void **data) packet.duration = av_rescale_q(packet.duration, ac->stream->codec->time_base, ac->stream->time_base); - ac->savepts = MP_NOPTS_VALUE; + ac->savepts = AV_NOPTS_VALUE; if (encode_lavc_write_frame(ao->encode_lavc_ctx, &packet) < 0) { MP_ERR(ao, "error writing at %f %f/%f\n", |