[FFmpeg-devel] uint8_t *buf -> const uint8_t *buf
Tue Jun 3 20:39:34 CEST 2008
Aurelien Jacobs wrote:
> Aurelien Jacobs wrote:
>> Ronald S. Bultje wrote:
>>> On Feb 2, 2008 8:40 AM, Aurelien Jacobs <aurel at gnuage.org> wrote:
>>>> Hum... It obviously won't work with joint stereo scrambled
>>>> streams. You will need to allocate another buffer instead of
>>>> reusing decoded_bytes_buffer. But the idea behind my patch is
>>>> still valid.
>>> Sure it will. The current one also reads/writes in/from the same buf
>>> if the datastream is encrypted (ptr1/ptr2 are both
>>> decoded_bytes_buffer). You are only changing the case where the
>>> stream is unscrambled from reading/writing from/to the input buffer
>>> to reading from the input buffer and writing into
>> No. In case the datastream is encrypted (ptr1/ptr2 are both
>> decoded_bytes_buffer), and that's why FFSWAP is used in current code.
>> My code will overwrite the beginning of decoded_bytes_buffer
>> when reading its end.
>> An alternative solution would be to use current FFSWAP code
>> for scrambled streams and use my new code for straight streams.
>> This would avoid allocating one more buffer.
> Something like the attached patch may work.
Old thread, but I finally looked at this and it didn't work. I can't
come up with a better solution then just memcopy the const buffer to a
nonconst buffer, would that be acceptable ?
More information about the ffmpeg-devel