From 2101b1f76e5e7eab4b4ea632db226fb76d99eeda Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 14 Jul 2020 18:01:32 -0700 Subject: *: rework avd/frameno handling for cached mode This brings the !--on-the-fly-encoding mode up to speed. The cached file header loses the total_frames counter, as the capture_frameno already represents this. Dropped frames are detected by simply looking at the difference between the previous capture_frameno and the current one. This simply gets passed to the encoder as a n_frames count so theora can duplicate the frames as needed. This was being done manually before by looking at the frameno and total frames in each header and maintaining separate counts for "extra frames" "missed frames" etc, and resubmitting entire frames multiply for encoding dropped frames. So a chunk of code has been thrown out from rmd_load_cache.c, and some general cleanups have occurred there as well. I also needed to add more locking around pdata->avd accesses. --- src/rmd_flush_to_ogg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rmd_flush_to_ogg.c') diff --git a/src/rmd_flush_to_ogg.c b/src/rmd_flush_to_ogg.c index b4ca6fb..6c5a0d8 100644 --- a/src/rmd_flush_to_ogg.c +++ b/src/rmd_flush_to_ogg.c @@ -127,7 +127,7 @@ void *rmdFlushToOgg(ProgData *pdata) { while (!pdata->th_encoding_clean) pthread_cond_wait(&pdata->theora_lib_clean, &pdata->theora_lib_mutex); pthread_mutex_unlock(&pdata->theora_lib_mutex); - rmdSyncEncodeImageBuffer(pdata); + rmdSyncEncodeImageBuffer(pdata, 1); } } -- cgit v1.2.1