fix segfault in standby

This commit is contained in:
redblue-pkt
2018-09-30 22:42:49 +02:00
committed by Thilo Graf
parent 9ee2cccc04
commit 26adad9268

View File

@@ -332,27 +332,30 @@ void CLCD::showTime(bool force)
ret = ioctl(fd, VFDSETTIME2, &now); ret = ioctl(fd, VFDSETTIME2, &now);
close(fd); close(fd);
#endif #endif
if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT)
{
#if HAVE_ARM_HARDWARE #if HAVE_ARM_HARDWARE
if (mode == MODE_STANDBY || (g_settings.lcd_info_line && mode == MODE_TVRADIO)) if (mode == MODE_STANDBY || (g_settings.lcd_info_line && mode == MODE_TVRADIO))
#else #else
if (ret < 0 && servicename.empty()) if (ret < 0 && servicename.empty())
#endif #endif
{
if (g_info.hw_caps->display_xres < 5)
sprintf(timestr, "%02d%02d", hour, minute);
else /* pad with spaces on the left side to center the time string */
sprintf(timestr, "%*s%02d:%02d",(g_info.hw_caps->display_xres - 5)/2, "", hour, minute);
ShowText(timestr, false);
}
else
{
if (vol_active)
{ {
showServicename(servicename); if (g_info.hw_caps->display_xres < 5)
vol_active = false; sprintf(timestr, "%02d%02d", hour, minute);
else /* pad with spaces on the left side to center the time string */
sprintf(timestr, "%*s%02d:%02d",(g_info.hw_caps->display_xres - 5)/2, "", hour, minute);
ShowText(timestr, false);
} }
else
{
if (vol_active)
{
showServicename(servicename);
vol_active = false;
}
}
last_display = 0;
} }
last_display = 0;
} }
} }