- /* refresh display, if required (include counter) */
- if (e_vbox_display_refresh && e_ext.vbox_display!=VBOX_DISPLAY_OFF)
- {
- char counter[32];
- struct message *message;
-
- SPRINT(counter, "%02d:%02d", e_vbox_counter/60, e_vbox_counter%60);
- if (e_vbox_counter_max)
- UPRINT(strchr(counter,'\0'), " of %02d:%02d", e_vbox_counter_max/60, e_vbox_counter_max%60);
-
- e_vbox_display_refresh = 0;
- message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_portlist->port_id, EPOINT_TO_PORT, MESSAGE_NOTIFY);
- SPRINT(message->param.notifyinfo.display, e_vbox_display, counter);
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) terminal %s pending display:%s\n", ea_endpoint->ep_serial, e_ext.number, message->param.notifyinfo.display);
- message_put(message);
- logmessage(message->type, &message->param, ea_endpoint->ep_portlist->port_id, DIRECTION_OUT);
- }
+ /* no display */
+ if (ea->e_ext.vbox_display == VBOX_DISPLAY_OFF)
+ return 0;
+
+ /* refresh display */
+ char counter[32];
+ struct lcr_msg *message;
+
+ SPRINT(counter, "%02d:%02d", ea->e_vbox_counter/60, ea->e_vbox_counter%60);
+ if (ea->e_vbox_counter_max)
+ UPRINT(strchr(counter,'\0'), " of %02d:%02d", ea->e_vbox_counter_max/60, ea->e_vbox_counter_max%60);
+
+ message = message_create(ea->ea_endpoint->ep_serial, ea->ea_endpoint->ep_portlist->port_id, EPOINT_TO_PORT, MESSAGE_NOTIFY);
+ SPRINT(message->param.notifyinfo.display, ea->e_vbox_display, counter);
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) terminal %s pending display:%s\n", ea->ea_endpoint->ep_serial, ea->e_ext.number, message->param.notifyinfo.display);
+ message_put(message);
+ ea->logmessage(message->type, &message->param, ea->ea_endpoint->ep_portlist->port_id, DIRECTION_OUT);
+
+ /* not playing anymore */
+ if (!ea->e_vbox_state==VBOX_STATE_PLAY && !ea->e_vbox_state==VBOX_STATE_RECORD_PLAY)
+ return 0;
+
+ schedule_timer(&ea->e_vbox_refresh, 1, 0);
+
+ return 0;