clean up video timestamp adjustment in -vsync mode

This commit is contained in:
F. Duncanh
2025-04-24 10:18:47 -04:00
parent 443f7c65d8
commit 2dfb156c63
2 changed files with 3 additions and 2 deletions

View File

@@ -469,7 +469,8 @@ uint64_t video_renderer_render_buffer(unsigned char* data, int *data_len, int *n
if (pts >= gst_video_pipeline_base_time) {
pts -= gst_video_pipeline_base_time;
} else {
logger_log(logger, LOGGER_ERR, "*** invalid ntp_time < gst_video_pipeline_base_time\n%8.6f ntp_time\n%8.6f base_time",
// adjust timestamps to be >= gst_video_pipeline_base time
logger_log(logger, LOGGER_DEBUG, "*** invalid ntp_time < gst_video_pipeline_base_time\n%8.6f ntp_time\n%8.6f base_time",
((double) *ntp_time) / SECOND_IN_NSECS, ((double) gst_video_pipeline_base_time) / SECOND_IN_NSECS);
return (uint64_t) gst_video_pipeline_base_time - pts;
}

View File

@@ -1823,7 +1823,7 @@ extern "C" void video_process (void *cls, raop_ntp_t *ntp, video_decode_struct *
data->ntp_time_remote = data->ntp_time_remote + remote_clock_offset;
pts_mismatch = video_renderer_render_buffer(data->data, &(data->data_len), &(data->nal_count), &(data->ntp_time_remote));
if (pts_mismatch) {
LOGI("adjust timestamps by %8.6f secs", (double) (pts_mismatch / SECOND_IN_NSECS));
LOGI("adjust timestamps by %8.6f secs", (double) pts_mismatch / SECOND_IN_NSECS);
remote_clock_offset += pts_mismatch;
}
count++;