[vlc-devel] [PATCH 1/2] httplive: fix Read func. (when caller skips data)
Jean-Paul Saman
jpsaman at videolan.org
Tue Jan 10 11:02:22 CET 2012
I stand with my earlier conclusion the patch is wrong.
Kind regards,
Jean-Paul Saman
On Mon, Jan 9, 2012 at 3:18 PM, Frederic YHUEL <fyhuel at viotech.net> wrote:
> On Wed, Jan 4, 2012 at 2:02 PM, Frederic YHUEL <fyhuel at viotech.net> wrote:
>>>>>>
>>>>>> diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
>>>>>> index 4d60d8a..58dc1db 100644
>>>>>> --- a/modules/stream_filter/httplive.c
>>>>>> +++ b/modules/stream_filter/httplive.c
>>>>>> @@ -1912,7 +1912,8 @@ static ssize_t hls_Read(stream_t *s, uint8_t *p_read, unsigned int i_read)
>>>>>>
>>>>>> if (len > 0)
>>>>>> {
>>>>>> - memcpy(p_read + copied, segment->data->p_buffer, len);
>>>>>> + if( p_read ) /* otherwise caller skips data */
>>>>>> + memcpy(p_read + copied, segment->data->p_buffer, len);
>>>>>
>>>>> Below you update the segment data buffer while p_read is NULL, which
>>>>> is the wrong thing to do.
>>>>>
>>>
>>> So what is the right thing to do? Do you agree that currently data is
>>> read (instead of being skipped) when p_read is null?
>>>
>>
>> I mean, what's the point to allocate a buffer and memcpy data in it,
>> if the caller just wants to skips that data?
>>
>> Ok it will not hinder perf a lot, but it makes code harder to understand.
>>
>> Or am I missing something?
>>
>
> Ping?
>
>
> --
> Frédéric
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list