[vlc-devel] [PATCH] MMS stream pausing

bl4 bl4 at playker.info
Sun Jun 15 17:45:39 CEST 2008


Rémi Denis-Courmont wrote:
> 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.
>   

Should be fixed now. I've split the patch into 2 parts in case there are 
other problems with the thread.

-- 
bl4

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-MMS-stream-pausing.patch
Type: text/x-patch
Size: 3051 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080615/089c7419/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-MMS-stream-pausing-keep-the-connection-alive.patch
Type: text/x-patch
Size: 4140 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080615/089c7419/attachment-0001.bin>


More information about the vlc-devel mailing list