diff options
author | Chris Robinson <[email protected]> | 2012-01-11 00:43:24 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-01-11 00:43:24 -0800 |
commit | d88596e13cb37fee5234522fc41e8702196f0558 (patch) | |
tree | ee8e9ca285dc33f129778decbcb633ace74e3493 /examples/alffmpeg.c | |
parent | c59bbe7c22103699bf77d6ffd20dbb78c48969cd (diff) |
There's no need to pass a buffer to avio_alloc_context
Diffstat (limited to 'examples/alffmpeg.c')
-rw-r--r-- | examples/alffmpeg.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/alffmpeg.c b/examples/alffmpeg.c index d4d70527..2c10efb1 100644 --- a/examples/alffmpeg.c +++ b/examples/alffmpeg.c @@ -194,14 +194,13 @@ FilePtr openAVData(const char *name, char *buffer, size_t buffer_len) file = (FilePtr)calloc(1, sizeof(*file)); if(file && (file->FmtCtx=avformat_alloc_context()) != NULL) { - static const int buflen = 4096; - file->membuf.buffer = buffer; file->membuf.length = buffer_len; file->membuf.pos = 0; - file->FmtCtx->pb = avio_alloc_context(av_malloc(buflen), buflen, 1, &file->membuf, - MemData_read, MemData_write, MemData_seek); + file->FmtCtx->pb = avio_alloc_context(NULL, 0, 0, &file->membuf, + MemData_read, MemData_write, + MemData_seek); if(file->FmtCtx->pb && avformat_open_input(&file->FmtCtx, name, NULL, NULL) == 0) { if(av_find_stream_info(file->FmtCtx) >= 0) @@ -231,9 +230,7 @@ FilePtr openAVCustom(const char *name, void *user_data, file = (FilePtr)calloc(1, sizeof(*file)); if(file && (file->FmtCtx=avformat_alloc_context()) != NULL) { - static const int buflen = 4096; - - file->FmtCtx->pb = avio_alloc_context(av_malloc(buflen), buflen, 1, user_data, + file->FmtCtx->pb = avio_alloc_context(NULL, 0, 0, user_data, read_packet, write_packet, seek); if(file->FmtCtx->pb && avformat_open_input(&file->FmtCtx, name, NULL, NULL) == 0) { |