[vlc-devel] [PATCH] araw: fix passthrough copying

Rafaël Carré funman at videolan.org
Mon Nov 11 18:24:14 CET 2013


Le 11/11/2013 18:01, Tristan Matthews a écrit :
> On Mon, Nov 11, 2013 at 11:55 AM, Rafaël Carré <funman at videolan.org> wrote:
>> Hello,
>>
>> Le 10/11/2013 17:29, Tristan Matthews a écrit :
>>> Fixes #9343 where in->i_buffer is greater than in->i_nb_samples * sizeof(frame).
>>
>> In which case does this happen?
> 
> When clicking "fingerprint" while playing an opus file (as per
> https://trac.videolan.org/vlc/ticket/9343 )
> I guess the larger question is, why does in have a bigger buffer than
> its sample count? I guess at some point the sample count or
> buffer_count is being updated properly?

Hmm ok I will try again to reproduce that bug (last time it worked fine
for me)

>> BTW out->i_buffer is equivalent to
>> in->i_nb_samples * enc->fmt_out.audio.i_bytes_per_frame
>> which is used 2 times, worth having a variable for it?
> 
> Where is it used a second time? I see it once, and then
> in->i_nb_samples * enc->fmt_out.audio.i_channels next to it.

You're right, i_channels != i_bytes_per_frame.
Sorry for the confusion.

> Best,
> t
> 
>>
>>> ---
>>>  modules/codec/araw.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/modules/codec/araw.c b/modules/codec/araw.c
>>> index 0d5c300..d4bd4b0 100644
>>> --- a/modules/codec/araw.c
>>> +++ b/modules/codec/araw.c
>>> @@ -739,7 +739,7 @@ static block_t *Encode( encoder_t *enc, block_t *in )
>>>          encode( out->p_buffer, in->p_buffer, in->i_nb_samples
>>>                                               * enc->fmt_out.audio.i_channels );
>>>      else
>>> -        memcpy( out->p_buffer, in->p_buffer, in->i_buffer );
>>> +        memcpy( out->p_buffer, in->p_buffer, out->i_buffer );
>>>      return out;
>>>  }




More information about the vlc-devel mailing list