Log PTS fixing at debug level

Audio PTS are retrieved by AudioRecord.getTimestamp(), so they do not
necessarily exactly match the number of samples (this allows to take
drift and lag into account).

As a consequence, two consecutive timestamps in microseconds may
sometimes end up within the same millisecond, causing the warning. This
is particularly true for the Matroska muxer which uses a timebase of
1/1000 (1 ms precision).

Since this is "expected", lower the log level from warning to debug.
This commit is contained in:
Romain Vimont 2023-11-14 09:33:59 +01:00
parent 200488111e
commit 15a3bad4ab

View File

@ -105,7 +105,7 @@ sc_recorder_write_stream(struct sc_recorder *recorder,
AVStream *stream = recorder->ctx->streams[st->index]; AVStream *stream = recorder->ctx->streams[st->index];
sc_recorder_rescale_packet(stream, packet); sc_recorder_rescale_packet(stream, packet);
if (st->last_pts != AV_NOPTS_VALUE && packet->pts <= st->last_pts) { if (st->last_pts != AV_NOPTS_VALUE && packet->pts <= st->last_pts) {
LOGW("Fixing PTS non monotonically increasing in stream %d " LOGD("Fixing PTS non monotonically increasing in stream %d "
"(%" PRIi64 " >= %" PRIi64 ")", "(%" PRIi64 " >= %" PRIi64 ")",
st->index, st->last_pts, packet->pts); st->index, st->last_pts, packet->pts);
packet->pts = ++st->last_pts; packet->pts = ++st->last_pts;