From 87598b556e21d569da9e3cb1a7e02b3f773d1bef Mon Sep 17 00:00:00 2001 From: Glenn Pringle Date: Thu, 16 Jul 2026 13:02:17 +1000 Subject: [PATCH 1/2] fix(playback): smooth on-goggle DVR playback DVR playback on the goggles dropped frames badly for two reasons: - The menu UI drives the panel at 1080p50, so 60fps DVR files lost 10 frames a second in an uneven 6:5 cadence and 90fps race files lost 40. The player now reads the file's frame rate from the demuxer and retimes the UI output to 1080p60 for the duration of playback (same 148.5MHz pixel clock, so OLED/FPGA settings stay valid), restoring 1080p50 on exit. 90fps files fall into an even 3:2 pulldown, the best the panel path can do. - The recorder muxed with a 1/fps stream time base, rounding every capture timestamp to a whole frame slot and baking judder into the file (the reason behind the "fps=59 or DVR is wrong" workaround). Streams are now muxed on the standard 90kHz clock so timestamps stay exact; this also makes recordings play smoother on PCs. --- src/driver/hardware-boxpro.c | 5 +++++ src/driver/hardware-goggle.c | 20 ++++++++++++++++++++ src/driver/hardware-goggle2.c | 21 +++++++++++++++++++++ src/driver/hardware.h | 1 + src/emulator/stubs.c | 1 + src/player/awdmx.c | 3 ++- src/player/awdmx.h | 1 + src/player/media.c | 11 +++++++++++ src/player/media.h | 1 + src/record/ffpack.c | 7 +++++-- src/ui/ui_player.c | 18 ++++++++++++++++++ 11 files changed, 86 insertions(+), 3 deletions(-) diff --git a/src/driver/hardware-boxpro.c b/src/driver/hardware-boxpro.c index 3409a9f3b..384ea521f 100644 --- a/src/driver/hardware-boxpro.c +++ b/src/driver/hardware-boxpro.c @@ -606,6 +606,11 @@ void Display_UI() { pthread_mutex_unlock(&hardware_mutex); } +// The BoxPRO UI already runs at 720p60, which suits 60 and 90 fps DVR files, +// so there is nothing to retime here. +void Display_UI_SetRefresh(int hz) { +} + void HDZero_open(int bw) { if (bw != g_hw_stat.hdz_bw) // reopen with different bw HDZero_Close(); diff --git a/src/driver/hardware-goggle.c b/src/driver/hardware-goggle.c index 585092fcd..d8239c3f5 100644 --- a/src/driver/hardware-goggle.c +++ b/src/driver/hardware-goggle.c @@ -596,6 +596,26 @@ void Display_UI() { pthread_mutex_unlock(&hardware_mutex); } +// 1080p50 and 1080p60 share the same 148.5MHz pixel clock, so the OLED and +// FPGA settings from Display_UI_init stay valid; only the vdpo timing changes. +void Display_UI_SetRefresh(int hz) { + int tmg = (hz == 60) ? VDPO_TMG_1080P60 : VDPO_TMG_1080P50; + + pthread_mutex_lock(&hardware_mutex); + if ((g_hw_stat.source_mode == SOURCE_MODE_UI) && (g_hw_stat.vdpo_tmg != tmg)) { + screen.display(0); + + system_exec((hz == 60) ? "dispw -s vdpo 1080p60" : "dispw -s vdpo 1080p50"); + g_hw_stat.vdpo_tmg = tmg; + system_exec("aww 0x0300b084 0x00001565"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11 + system_exec("aww 0x06542018 0x00000044"); // disable horizontal chroma FIR filter. + + screen.display(1); + LOGI("Display_UI_SetRefresh: %dHz", (hz == 60) ? 60 : 50); + } + pthread_mutex_unlock(&hardware_mutex); +} + void Display_720P60_50_t(int mode, uint8_t is_43) // fps: 0=50, 1=60 { screen.display(0); diff --git a/src/driver/hardware-goggle2.c b/src/driver/hardware-goggle2.c index 9a80ed116..9cd7baf0a 100755 --- a/src/driver/hardware-goggle2.c +++ b/src/driver/hardware-goggle2.c @@ -569,6 +569,27 @@ void Display_UI() { pthread_mutex_unlock(&hardware_mutex); } +// 1080p50 and 1080p60 share the same 148.5MHz pixel clock, so the OLED and +// FPGA settings from Display_UI_init stay valid; only the vdpo timing changes. +void Display_UI_SetRefresh(int hz) { + int tmg = (hz == 60) ? VDPO_TMG_1080P60 : VDPO_TMG_1080P50; + + pthread_mutex_lock(&hardware_mutex); + if ((g_hw_stat.source_mode == SOURCE_MODE_UI) && (g_hw_stat.vdpo_tmg != tmg)) { + screen.display(0); + + system_exec((hz == 60) ? "dispw -s vdpo 1080p60" : "dispw -s vdpo 1080p50"); + g_hw_stat.vdpo_tmg = tmg; + system_exec("aww 0x0300b340 0x00000008"); + system_exec("aww 0x0300b084 0x00003fff"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11 + system_exec("aww 0x06542018 0x00000044"); // disable horizontal chroma FIR filter. + + screen.display(1); + LOGI("Display_UI_SetRefresh: %dHz", (hz == 60) ? 60 : 50); + } + pthread_mutex_unlock(&hardware_mutex); +} + void Display_720P60_50_t(int mode, uint8_t is_43) // fps: 0=50, 1=60 { screen.display(0); diff --git a/src/driver/hardware.h b/src/driver/hardware.h index b232a713c..653e11a2b 100644 --- a/src/driver/hardware.h +++ b/src/driver/hardware.h @@ -89,6 +89,7 @@ void Source_HDMI_in(); void Source_AV(bool is_av_in); void Display_UI_init(); void Display_UI(); +void Display_UI_SetRefresh(int hz); // retime the UI output for DVR playback (e.g. 60); 0 restores the default UI timing void Display_720P90(int mode); void Display_720P60_50(int mode, uint8_t is_43); diff --git a/src/emulator/stubs.c b/src/emulator/stubs.c index 6a6c64a44..1a7b4386e 100644 --- a/src/emulator/stubs.c +++ b/src/emulator/stubs.c @@ -24,6 +24,7 @@ void *thread_media(void *params) { return NULL; } void media_control(media_t *media, player_cmd_t *cmd) {} media_t *media_instantiate(char *filename, notify_cb_t notify) { return NULL; } void media_exit(media_t *media) {} +int media_get_fps(media_t *media) { return 0; } #if HDZGOGGLE void Display_HDZ(int mode, int is_43) {} diff --git a/src/player/awdmx.c b/src/player/awdmx.c index 5d47f1e5c..4a37ddeff 100644 --- a/src/player/awdmx.c +++ b/src/player/awdmx.c @@ -181,8 +181,9 @@ AwdmxContext_t *awdmx_open(char *sFile, CB_onDmxEof cbOnEof, void *context) { dmxCtx->width = DemuxMediaInfo.mVideoStreamInfo[nIndex].mWidth; dmxCtx->height = DemuxMediaInfo.mVideoStreamInfo[nIndex].mHeight; dmxCtx->codecType = DemuxMediaInfo.mVideoStreamInfo[nIndex].mCodecType; + dmxCtx->fpsX1000 = DemuxMediaInfo.mVideoStreamInfo[nIndex].mFrameRate; dmxCtx->msDuration = DemuxMediaInfo.mDuration; - LOGD("stream info %dx%d", DemuxMediaInfo.mVideoStreamInfo[nIndex].mWidth, DemuxMediaInfo.mVideoStreamInfo[nIndex].mHeight); + LOGD("stream info %dx%d @%dmfps", DemuxMediaInfo.mVideoStreamInfo[nIndex].mWidth, DemuxMediaInfo.mVideoStreamInfo[nIndex].mHeight, dmxCtx->fpsX1000); if (DemuxMediaInfo.mAudioNum > 0) { nIndex = DemuxMediaInfo.mAudioIndex; diff --git a/src/player/awdmx.h b/src/player/awdmx.h index d9ab4c4c2..038d469ae 100644 --- a/src/player/awdmx.h +++ b/src/player/awdmx.h @@ -30,6 +30,7 @@ typedef struct int videoNum; uint16_t width; uint16_t height; + int fpsX1000; // video frame rate * 1000, 0 if unknown PAYLOAD_TYPE_E codecType; int audioNum; diff --git a/src/player/media.c b/src/player/media.c index 59abb2ee4..6e8e3b555 100644 --- a/src/player/media.c +++ b/src/player/media.c @@ -204,6 +204,17 @@ void media_control(media_t *media, player_cmd_t *cmd) { pthread_mutex_unlock(&playCtx->mutex); } +int media_get_fps(media_t *media) { + if (!media) + return 0; + + PlayContext_t *playCtx = (PlayContext_t *)media->context; + if (!playCtx || !playCtx->dmx) + return 0; + + return (playCtx->dmx->fpsX1000 + 500) / 1000; +} + media_t *media_instantiate(char *filename, notify_cb_t notify) { int ret = 0; pthread_t pid; diff --git a/src/player/media.h b/src/player/media.h index e713f3b1f..a165a2a04 100644 --- a/src/player/media.h +++ b/src/player/media.h @@ -39,6 +39,7 @@ typedef struct { media_t *media_instantiate(char *filename, notify_cb_t notify); void media_exit(media_t *media); void media_control(media_t *media, player_cmd_t *cmd); +int media_get_fps(media_t *media); // video fps rounded to nearest integer, 0 if unknown #ifdef __cplusplus } diff --git a/src/record/ffpack.c b/src/record/ffpack.c index 4cd116f35..2810b87f9 100755 --- a/src/record/ffpack.c +++ b/src/record/ffpack.c @@ -196,8 +196,11 @@ int ffpack_newVideoStream(FFPack_t* ff, uint16_t programId, FFStreamParameters_t stream->r_frame_rate.den = 0;//1; stream->avg_frame_rate.num = param->video.fps; stream->avg_frame_rate.den = 1; - stream->time_base.num = 1;//0; - stream->time_base.den = param->video.fps;//100000;//1; //10us + /* a 1/fps time base rounds every capture timestamp to a whole frame + * slot (and collides when the real rate drifts from the configured + * fps), baking judder into the file; 90kHz keeps timestamps exact */ + stream->time_base.num = 1; + stream->time_base.den = 90000; cp->codec_type = param->mediaType; cp->codec_id = param->codecId; cp->width = param->video.width; diff --git a/src/ui/ui_player.c b/src/ui/ui_player.c index 232880e5b..f360ceda3 100644 --- a/src/ui/ui_player.c +++ b/src/ui/ui_player.c @@ -8,6 +8,7 @@ #include "../conf/ui.h" #include "common.hh" +#include "driver/hardware.h" #include "player/media.h" #include "record/record_definitions.h" #include "ui/ui_style.h" @@ -26,6 +27,8 @@ LV_IMG_DECLARE(img_Play_0); LV_IMG_DECLARE(img_Stop_0); LV_IMG_DECLARE(img_star); +static bool ui_retimed_for_playback = false; + static bool stars_positioned_on_timeline = false; static size_t stars_count = 0; static size_t stars_timestamps_s[MAX_STARS] = { @@ -346,6 +349,17 @@ void mplayer_file(char *fname) { load_stars(fname); init_mplayer(); media_init(fname); + + // The menu UI refreshes at 50Hz on the goggles, which drops frames of + // 60 and 90 fps DVR files unevenly; retime to 60Hz while playing (90fps + // then falls into an even 3:2 cadence) + int fps = media_get_fps(media); + LOGI("mplayer fps=%d", fps); + if (fps >= 55) { + Display_UI_SetRefresh(60); + ui_retimed_for_playback = true; + } + media_start(); update_mplayer(); } @@ -356,6 +370,10 @@ void mplayer_exit() { media_exit(media); media = NULL; } + if (ui_retimed_for_playback) { + Display_UI_SetRefresh(0); + ui_retimed_for_playback = false; + } pthread_mutex_lock(&lvgl_mutex); free_mplayer(); } From cf7295b472c433fbdb6da2fd83ef3daf5f0890cd Mon Sep 17 00:00:00 2001 From: Glenn Pringle Date: Thu, 16 Jul 2026 13:31:07 +1000 Subject: [PATCH 2/2] feat(playback): true 90fps DVR playback at 720p90 Follow-up to the playback smoothing fix: instead of playing 90fps race DVR at 60Hz with a 3:2 pulldown, the player now retimes the output to 720p90 while the file plays, showing every frame. The menu stays at 1080p for browsing; starting a 90fps file switches the vdpo output to 720p90 reusing the timing, clock phases and OLED mode already proven by the live 720p90 path, and the video surface is sized 1280x720 to fill it. Exiting the player restores the stock menu timing with a full Display_UI_init. 60fps files keep the lighter 1080p60 retime on the same pixel clock. The retime decision moved from ui_player into the media engine, since the video output rect has to be sized before the decoder pipeline is prepared; failure paths restore the menu timing too. --- src/driver/hardware-goggle.c | 31 +++++++++++++++++------- src/driver/hardware-goggle2.c | 34 ++++++++++++++++++++------- src/driver/hardware.h | 2 +- src/emulator/stubs.c | 1 - src/player/media.c | 44 ++++++++++++++++++++++++----------- src/player/media.h | 1 - src/ui/ui_player.c | 18 -------------- 7 files changed, 80 insertions(+), 51 deletions(-) diff --git a/src/driver/hardware-goggle.c b/src/driver/hardware-goggle.c index d8239c3f5..6396c34b1 100644 --- a/src/driver/hardware-goggle.c +++ b/src/driver/hardware-goggle.c @@ -596,22 +596,37 @@ void Display_UI() { pthread_mutex_unlock(&hardware_mutex); } -// 1080p50 and 1080p60 share the same 148.5MHz pixel clock, so the OLED and -// FPGA settings from Display_UI_init stay valid; only the vdpo timing changes. +// Retime the UI output for DVR playback. 60Hz keeps the 1080p UI on the +// same 148.5MHz pixel clock, so the OLED and FPGA settings from +// Display_UI_init stay valid. 90Hz reuses the vdpo timing, clock phases and +// OLED mode proven by the live 720p90 path (the FPGA stays on the UI input). +// 0 restores the stock menu timing with a full Display_UI_init. void Display_UI_SetRefresh(int hz) { - int tmg = (hz == 60) ? VDPO_TMG_1080P60 : VDPO_TMG_1080P50; + int tmg = (hz == 90) ? VDPO_TMG_720P90 : (hz == 60) ? VDPO_TMG_1080P60 : VDPO_TMG_1080P50; pthread_mutex_lock(&hardware_mutex); if ((g_hw_stat.source_mode == SOURCE_MODE_UI) && (g_hw_stat.vdpo_tmg != tmg)) { screen.display(0); - system_exec((hz == 60) ? "dispw -s vdpo 1080p60" : "dispw -s vdpo 1080p50"); - g_hw_stat.vdpo_tmg = tmg; - system_exec("aww 0x0300b084 0x00001565"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11 - system_exec("aww 0x06542018 0x00000044"); // disable horizontal chroma FIR filter. + if (hz == 90) { + system_exec("dispw -s vdpo 720p90"); + g_hw_stat.vdpo_tmg = VDPO_TMG_720P90; + vclk_phase_set(VIDEO_SOURCE_HDZERO_IN_720P90, 0); + pclk_phase_set(VIDEO_SOURCE_HDZERO_IN_720P90); + screen.vtmg(1); + system_exec("aww 0x0300b084 0x00001565"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11 + system_exec("aww 0x06542018 0x00000044"); // disable horizontal chroma FIR filter. + } else if (hz == 60) { + system_exec("dispw -s vdpo 1080p60"); + g_hw_stat.vdpo_tmg = VDPO_TMG_1080P60; + system_exec("aww 0x0300b084 0x00001565"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11 + system_exec("aww 0x06542018 0x00000044"); // disable horizontal chroma FIR filter. + } else { + Display_UI_init(); + } screen.display(1); - LOGI("Display_UI_SetRefresh: %dHz", (hz == 60) ? 60 : 50); + LOGI("Display_UI_SetRefresh: %dHz", hz ? hz : 50); } pthread_mutex_unlock(&hardware_mutex); } diff --git a/src/driver/hardware-goggle2.c b/src/driver/hardware-goggle2.c index 9cd7baf0a..fe8beb07a 100755 --- a/src/driver/hardware-goggle2.c +++ b/src/driver/hardware-goggle2.c @@ -569,23 +569,39 @@ void Display_UI() { pthread_mutex_unlock(&hardware_mutex); } -// 1080p50 and 1080p60 share the same 148.5MHz pixel clock, so the OLED and -// FPGA settings from Display_UI_init stay valid; only the vdpo timing changes. +// Retime the UI output for DVR playback. 60Hz keeps the 1080p UI on the +// same 148.5MHz pixel clock, so the OLED and FPGA settings from +// Display_UI_init stay valid. 90Hz reuses the vdpo timing, clock phases and +// OLED mode proven by the live 720p90 path (the FPGA stays on the UI input). +// 0 restores the stock menu timing with a full Display_UI_init. void Display_UI_SetRefresh(int hz) { - int tmg = (hz == 60) ? VDPO_TMG_1080P60 : VDPO_TMG_1080P50; + int tmg = (hz == 90) ? VDPO_TMG_720P90 : (hz == 60) ? VDPO_TMG_1080P60 : VDPO_TMG_1080P50; pthread_mutex_lock(&hardware_mutex); if ((g_hw_stat.source_mode == SOURCE_MODE_UI) && (g_hw_stat.vdpo_tmg != tmg)) { screen.display(0); - system_exec((hz == 60) ? "dispw -s vdpo 1080p60" : "dispw -s vdpo 1080p50"); - g_hw_stat.vdpo_tmg = tmg; - system_exec("aww 0x0300b340 0x00000008"); - system_exec("aww 0x0300b084 0x00003fff"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11 - system_exec("aww 0x06542018 0x00000044"); // disable horizontal chroma FIR filter. + if (hz == 90) { + system_exec("dispw -s vdpo 720p90"); + g_hw_stat.vdpo_tmg = VDPO_TMG_720P90; + system_exec("aww 0x0300b340 0x00000008"); + vclk_phase_set(VIDEO_SOURCE_HDZERO_IN_720P90, 0); + pclk_phase_set(VIDEO_SOURCE_HDZERO_IN_720P90); + screen.vtmg(1); + system_exec("aww 0x0300b084 0x00003fff"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11 + system_exec("aww 0x06542018 0x00000044"); // disable horizontal chroma FIR filter. + } else if (hz == 60) { + system_exec("dispw -s vdpo 1080p60"); + g_hw_stat.vdpo_tmg = VDPO_TMG_1080P60; + system_exec("aww 0x0300b340 0x00000008"); + system_exec("aww 0x0300b084 0x00003fff"); // Set vdpo clock driver strength to level 2. Refer datasheet 12.7.5.11 + system_exec("aww 0x06542018 0x00000044"); // disable horizontal chroma FIR filter. + } else { + Display_UI_init(); + } screen.display(1); - LOGI("Display_UI_SetRefresh: %dHz", (hz == 60) ? 60 : 50); + LOGI("Display_UI_SetRefresh: %dHz", hz ? hz : 50); } pthread_mutex_unlock(&hardware_mutex); } diff --git a/src/driver/hardware.h b/src/driver/hardware.h index 653e11a2b..fe209c5cc 100644 --- a/src/driver/hardware.h +++ b/src/driver/hardware.h @@ -89,7 +89,7 @@ void Source_HDMI_in(); void Source_AV(bool is_av_in); void Display_UI_init(); void Display_UI(); -void Display_UI_SetRefresh(int hz); // retime the UI output for DVR playback (e.g. 60); 0 restores the default UI timing +void Display_UI_SetRefresh(int hz); // retime the UI output for DVR playback (60 = 1080p60, 90 = 720p90); 0 restores the default UI timing void Display_720P90(int mode); void Display_720P60_50(int mode, uint8_t is_43); diff --git a/src/emulator/stubs.c b/src/emulator/stubs.c index 1a7b4386e..6a6c64a44 100644 --- a/src/emulator/stubs.c +++ b/src/emulator/stubs.c @@ -24,7 +24,6 @@ void *thread_media(void *params) { return NULL; } void media_control(media_t *media, player_cmd_t *cmd) {} media_t *media_instantiate(char *filename, notify_cb_t notify) { return NULL; } void media_exit(media_t *media) {} -int media_get_fps(media_t *media) { return 0; } #if HDZGOGGLE void Display_HDZ(int mode, int is_43) {} diff --git a/src/player/media.c b/src/player/media.c index 6e8e3b555..485d38985 100644 --- a/src/player/media.c +++ b/src/player/media.c @@ -17,6 +17,7 @@ #include "adec2ao.h" #include "awdmx.h" +#include "driver/hardware.h" #include "gogglemsg.h" #include "vdec2vo.h" #include "version.h" @@ -66,6 +67,7 @@ typedef struct pthread_mutex_t mutex; int playingTime; // ms + int retimedHz; // nonzero while the UI output is retimed for this file } PlayContext_t; static int play_start(PlayContext_t *playCtx) { @@ -204,17 +206,6 @@ void media_control(media_t *media, player_cmd_t *cmd) { pthread_mutex_unlock(&playCtx->mutex); } -int media_get_fps(media_t *media) { - if (!media) - return 0; - - PlayContext_t *playCtx = (PlayContext_t *)media->context; - if (!playCtx || !playCtx->dmx) - return 0; - - return (playCtx->dmx->fpsX1000 + 500) / 1000; -} - media_t *media_instantiate(char *filename, notify_cb_t notify) { int ret = 0; pthread_t pid; @@ -249,8 +240,29 @@ media_t *media_instantiate(char *filename, notify_cb_t notify) { goto failed; } else { Vdec2VoParams_t vvParams; + int voWidth = VO_WIDTH; + int voHeight = VO_HEIGHT; memset(&vvParams, 0, sizeof(vvParams)); +#if PLAY_HDZERO && (defined(HDZGOGGLE) || defined(HDZGOGGLE2)) + // The menu UI drives the panel at 1080p50, which drops frames of + // 60/90fps DVR files unevenly. Retime for the duration of playback: + // 90fps files reuse the live-mode 720p90 timing so every frame is + // shown, 60fps files keep the 1080p UI on the same pixel clock. + int fps = (playCtx->dmx->fpsX1000 + 500) / 1000; + if (fps >= 80) { + playCtx->retimedHz = 90; + voWidth = 1280; + voHeight = 720; + } else if (fps >= 55) { + playCtx->retimedHz = 60; + } + if (playCtx->retimedHz) { + LOGD("retiming display to %dHz for %dfps file", playCtx->retimedHz, fps); + Display_UI_SetRefresh(playCtx->retimedHz); + } +#endif + vvParams.initRotation = 0; vvParams.pixelFormat = MM_PIXEL_FORMAT_YVU_PLANAR_420; @@ -258,8 +270,8 @@ media_t *media_instantiate(char *filename, notify_cb_t notify) { vvParams.vdec.width = playCtx->dmx->width; vvParams.vdec.height = playCtx->dmx->height; - vvParams.vo.width = VO_WIDTH; - vvParams.vo.height = VO_HEIGHT; + vvParams.vo.width = voWidth; + vvParams.vo.height = voHeight; vvParams.vo.intfType = VO_intfTYPE; vvParams.vo.intfSync = VO_intfSYNC; vvParams.vo.uiChn = VO_uiCHN; @@ -299,6 +311,9 @@ media_t *media_instantiate(char *filename, notify_cb_t notify) { adec2ao_deinitSys(playCtx->aa); vdec2vo_deinitSys(playCtx->vv); awdmx_close(playCtx->dmx); + if (playCtx->retimedHz) { + Display_UI_SetRefresh(0); + } pthread_mutex_destroy(&playCtx->mutex); free(playCtx); LOGD("exit done"); @@ -316,6 +331,9 @@ void media_exit(media_t *media) { adec2ao_deinitSys(playCtx->aa); vdec2vo_deinitSys(playCtx->vv); awdmx_close(playCtx->dmx); + if (playCtx->retimedHz) { + Display_UI_SetRefresh(0); + } pthread_mutex_destroy(&playCtx->mutex); free(media->context); free(media); diff --git a/src/player/media.h b/src/player/media.h index a165a2a04..e713f3b1f 100644 --- a/src/player/media.h +++ b/src/player/media.h @@ -39,7 +39,6 @@ typedef struct { media_t *media_instantiate(char *filename, notify_cb_t notify); void media_exit(media_t *media); void media_control(media_t *media, player_cmd_t *cmd); -int media_get_fps(media_t *media); // video fps rounded to nearest integer, 0 if unknown #ifdef __cplusplus } diff --git a/src/ui/ui_player.c b/src/ui/ui_player.c index f360ceda3..232880e5b 100644 --- a/src/ui/ui_player.c +++ b/src/ui/ui_player.c @@ -8,7 +8,6 @@ #include "../conf/ui.h" #include "common.hh" -#include "driver/hardware.h" #include "player/media.h" #include "record/record_definitions.h" #include "ui/ui_style.h" @@ -27,8 +26,6 @@ LV_IMG_DECLARE(img_Play_0); LV_IMG_DECLARE(img_Stop_0); LV_IMG_DECLARE(img_star); -static bool ui_retimed_for_playback = false; - static bool stars_positioned_on_timeline = false; static size_t stars_count = 0; static size_t stars_timestamps_s[MAX_STARS] = { @@ -349,17 +346,6 @@ void mplayer_file(char *fname) { load_stars(fname); init_mplayer(); media_init(fname); - - // The menu UI refreshes at 50Hz on the goggles, which drops frames of - // 60 and 90 fps DVR files unevenly; retime to 60Hz while playing (90fps - // then falls into an even 3:2 cadence) - int fps = media_get_fps(media); - LOGI("mplayer fps=%d", fps); - if (fps >= 55) { - Display_UI_SetRefresh(60); - ui_retimed_for_playback = true; - } - media_start(); update_mplayer(); } @@ -370,10 +356,6 @@ void mplayer_exit() { media_exit(media); media = NULL; } - if (ui_retimed_for_playback) { - Display_UI_SetRefresh(0); - ui_retimed_for_playback = false; - } pthread_mutex_lock(&lvgl_mutex); free_mplayer(); }