mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-06 15:49:50 +08:00
avformat/avio: Move internal AVIOContext fields to avio_internal.h
Currently AVIOContext's private fields are all over AVIOContext. This commit moves them into a new structure in avio_internal.h instead. Said structure contains the public AVIOContext as its first element in order to avoid having to allocate a separate AVIOContextInternal which is costly for those use cases where one just wants to access an already existing buffer via the AVIOContext-API. For these cases ffio_init_context() can't fail and always returned zero, which was typically not checked. Therefore it has been made to not return anything. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -154,13 +154,13 @@ static int send_command_packet(MMSTContext *mmst)
|
||||
|
||||
static int mms_put_utf16(MMSContext *mms, const uint8_t *src)
|
||||
{
|
||||
AVIOContext bic;
|
||||
FFIOContext bic;
|
||||
int size = mms->write_out_ptr - mms->out_buffer;
|
||||
int len;
|
||||
ffio_init_context(&bic, mms->write_out_ptr,
|
||||
sizeof(mms->out_buffer) - size, 1, NULL, NULL, NULL, NULL);
|
||||
|
||||
len = avio_put_str16le(&bic, src);
|
||||
len = avio_put_str16le(&bic.pub, src);
|
||||
if (len < 0)
|
||||
return len;
|
||||
mms->write_out_ptr += len;
|
||||
|
Reference in New Issue
Block a user