[vlc-devel] [PATCH] MMS stream pausing
Rémi Denis-Courmont
rdenis at simphalempin.com
Fri Jun 13 17:22:26 CEST 2008
Le vendredi 13 juin 2008 02:23:00 bl4, vous avez écrit :
> + case ACCESS_CAN_PAUSE:
> + pb_bool = (bool*)va_arg( args, bool* );
> + *pb_bool = true;
> + break;
> +
> case ACCESS_CAN_CONTROL_PACE:
> pb_bool = (bool*)va_arg( args, bool* );
> *pb_bool = true;
Could remain factorized...
> + while (!p_thread->b_die) {
> + if (p_thread->b_paused) {
> + if (!p_thread->last_ping_time) {
> + p_thread->last_ping_time = time(NULL);
> + } else if (time(NULL) > p_thread->last_ping_time + 10) {
> + mms_CommandSend( p_access, 0x1b, 0, 0, NULL, 0 );
> + p_thread->last_ping_time = time(NULL);
Looks suspiciously lock-free?
> + }
> + } else {
> + if (p_thread->last_ping_time) {
> + p_thread->last_ping_time = NULL;
> + }
> + }
> + msleep(10000);
Waking up the CPU every 10ms? Please, no.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list