music control - handle out of bounds len/pos of playback

This commit is contained in:
Carsten Haitzler 2021-01-09 04:11:38 +00:00
parent 6ec7dd8a69
commit 9001073b0b
2 changed files with 3 additions and 0 deletions

View File

@ -405,6 +405,7 @@ prop_changed(void *data, Eldbus_Proxy *proxy EINA_UNUSED, void *event_info)
long long llval = 0;
eina_value_get(value, &llval);
if (llval < 0) llval = 0;
ctxt->position = (double)llval / 1000000.0;
music_control_pos_update(ctxt);
}

View File

@ -12,6 +12,8 @@ _pos_update(E_Music_Control_Instance *inst)
msg->count = 2;
msg->val[0] = inst->ctxt->position;
msg->val[1] = inst->ctxt->meta_length;
if (msg->val[0] < 0.0) msg->val[0] = 0.0;
if (msg->val[0] > msg->val[1]) msg->val[0] = msg->val[1];
edje_object_message_send(inst->content_popup, EDJE_MESSAGE_FLOAT_SET, 1, msg);
}