diff options
Diffstat (limited to 'src/buffer')
| -rw-r--r-- | src/buffer/peak_buffer.h | 2 | ||||
| -rw-r--r-- | src/buffer/video.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/buffer/peak_buffer.h b/src/buffer/peak_buffer.h index 2a68e9c..fb31293 100644 --- a/src/buffer/peak_buffer.h +++ b/src/buffer/peak_buffer.h @@ -1,7 +1,7 @@ #pragma once #include <al/types.h> -#include <nnwt/common.h> +#include <nnwt/buffer.h> struct camu_peak_buffer { struct nn_buffer buffer; diff --git a/src/buffer/video.c b/src/buffer/video.c index 8bcb1e1..93356ac 100644 --- a/src/buffer/video.c +++ b/src/buffer/video.c @@ -1,5 +1,4 @@ #define AL_LOG_SECTION "video_buffer" -//#define AL_LOG_ENABLE_TRACE #include <al/log.h> #ifdef CAMU_HAVE_FFMPEG @@ -126,6 +125,7 @@ static bool push_av_frame_internal(struct camu_video_buffer *buf, AVFrame *frame f64 base_pts = atomic_load(f64)(&buf->pts, AL_ATOMIC_ACQUIRE); f64 duration = camu_ff_frame_duration(frame) * av_q2d(stream->time_base); if (!buf->single_frame && frame_is_late(buf->clock, base_pts, pts, duration)) { + log_debug("Discarding late frame with PTS %f.", pts); return false; } if (base_pts == -1.0) atomic_store(f64)(&buf->pts, pts, AL_ATOMIC_RELEASE); @@ -234,8 +234,9 @@ bool camu_video_buffer_read(struct camu_video_buffer *buf, void *out, bool *weig f64 base_pts = atomic_load(f64)(&buf->pts, AL_ATOMIC_ACQUIRE); if (!buf->single_frame) { - bool set_clock = !buf->weighted_first_read; - f64 pts = camu_clock_get_pts(buf->clock, buf->latency, set_clock); + bool allow_set = !buf->weighted_first_read; + bool armed_for_pause = false; + f64 pts = camu_clock_get_pts(buf->clock, buf->latency, allow_set, &armed_for_pause); if (!CAMU_PTS_CONSIDER_PAUSED(pts) && pts > base_pts) { base_pts = pts; } @@ -280,7 +281,7 @@ bool camu_video_buffer_read(struct camu_video_buffer *buf, void *out, bool *weig *weighted = true; buf->weighted_first_read = false; } else if (ret == CAMU_QUEUE_MORE) { - log_trace("Underrun."); + log_warn("Underrun."); } return ret == CAMU_QUEUE_OK || ret == CAMU_QUEUE_MORE; |