1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avio: rename av_alloc_put_byte -> avio_alloc_context for consistency

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
Anton Khirnov 2011-02-20 15:03:29 +01:00 committed by Ronald S. Bultje
parent 484a337cd7
commit 8d9ac969cb
5 changed files with 26 additions and 5 deletions

View File

@ -752,7 +752,7 @@ static int read_gab2_sub(AVStream *st, AVPacket *pkt) {
AVIStream *ast = st->priv_data; AVIStream *ast = st->priv_data;
AVInputFormat *sub_demuxer; AVInputFormat *sub_demuxer;
AVRational time_base; AVRational time_base;
AVIOContext *pb = av_alloc_put_byte(pkt->data + 7, AVIOContext *pb = avio_alloc_context( pkt->data + 7,
pkt->size - 7, pkt->size - 7,
0, NULL, NULL, NULL, NULL); 0, NULL, NULL, NULL, NULL);
AVProbeData pd; AVProbeData pd;

View File

@ -370,8 +370,17 @@ attribute_deprecated int init_put_byte(AVIOContext *s,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
int64_t (*seek)(void *opaque, int64_t offset, int whence)); int64_t (*seek)(void *opaque, int64_t offset, int whence));
attribute_deprecated AVIOContext *av_alloc_put_byte(
unsigned char *buffer,
int buffer_size,
int write_flag,
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
int64_t (*seek)(void *opaque, int64_t offset, int whence));
#endif #endif
AVIOContext *av_alloc_put_byte(
AVIOContext *avio_alloc_context(
unsigned char *buffer, unsigned char *buffer,
int buffer_size, int buffer_size,
int write_flag, int write_flag,

View File

@ -87,9 +87,21 @@ int init_put_byte(AVIOContext *s,
return ffio_init_context(s, buffer, buffer_size, write_flag, opaque, return ffio_init_context(s, buffer, buffer_size, write_flag, opaque,
read_packet, write_packet, seek); read_packet, write_packet, seek);
} }
AVIOContext *av_alloc_put_byte(
unsigned char *buffer,
int buffer_size,
int write_flag,
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
int64_t (*seek)(void *opaque, int64_t offset, int whence))
{
return avio_alloc_context(buffer, buffer_size, write_flag, opaque,
read_packet, write_packet, seek);
}
#endif #endif
AVIOContext *av_alloc_put_byte( AVIOContext *avio_alloc_context(
unsigned char *buffer, unsigned char *buffer,
int buffer_size, int buffer_size,
int write_flag, int write_flag,

View File

@ -311,7 +311,7 @@ rdt_parse_packet (AVFormatContext *ctx, PayloadContext *rdt, AVStream *st,
if (res > 0) { if (res > 0) {
if (st->codec->codec_id == CODEC_ID_AAC) { if (st->codec->codec_id == CODEC_ID_AAC) {
memcpy (rdt->buffer, buf + pos, len - pos); memcpy (rdt->buffer, buf + pos, len - pos);
rdt->rmctx->pb = av_alloc_put_byte (rdt->buffer, len - pos, 0, rdt->rmctx->pb = avio_alloc_context (rdt->buffer, len - pos, 0,
NULL, NULL, NULL, NULL); NULL, NULL, NULL, NULL);
} }
goto get_cache; goto get_cache;

View File

@ -236,7 +236,7 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
return NULL; return NULL;
} }
pb = av_alloc_put_byte(buffer, 1 << wf->sector_bits, 0, wf, pb = avio_alloc_context(buffer, 1 << wf->sector_bits, 0, wf,
wtvfile_read_packet, NULL, wtvfile_seek); wtvfile_read_packet, NULL, wtvfile_seek);
if (!pb) { if (!pb) {
av_free(buffer); av_free(buffer);