[FFmpeg-devel] uint8_t *buf -> const uint8_t *buf

Aurelien Jacobs aurel
Sat Feb 2 14:57:19 CET 2008

Ronald S. Bultje wrote:

> Hi,
> 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
> decoded_bytes_buffer.
> Right?

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.


More information about the ffmpeg-devel mailing list