skin: touchscreen: fix rewind in long files

Fix a possible overflow in the elapsed time calculation.

Change-Id: I211777d8144f76889003239b9a49e4fc56184c8f
This commit is contained in:
Roman Artiukhin 2026-05-30 12:49:12 +03:00 committed by Aidan MacDonald
parent a7754eee71
commit c052d11673

View file

@ -204,24 +204,11 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset)
if (!gwps->id3) if (!gwps->id3)
break; break;
if (gevent.id == GESTURE_HOLD || audio_pre_ff_rewind();
gevent.id == GESTURE_DRAGSTART || gwps->id3->elapsed = gwps->id3->length / 1000 * (*edge_offset);
gevent.id == GESTURE_DRAG)
{
audio_pre_ff_rewind();
gwps->id3->elapsed = gwps->id3->length * (*edge_offset) / 1000;
}
else if (gevent.id == GESTURE_RELEASE)
{
audio_ff_rewind(gwps->id3->elapsed);
}
else
{
gwps->id3->elapsed = gwps->id3->length * (*edge_offset) / 1000;
audio_pre_ff_rewind();
audio_ff_rewind(gwps->id3->elapsed);
}
if (gevent.id == GESTURE_TAP || gevent.id == GESTURE_RELEASE)
audio_ff_rewind(gwps->id3->elapsed);
} break; } break;
case ACTION_TOUCH_VOLUME: case ACTION_TOUCH_VOLUME: