diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-20 12:37:24 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-20 12:37:24 +0200 |
commit | 35a8387b402692933620412d41e2939aca4f6935 (patch) | |
tree | 968f88f1afd209d6ea4bd782b047925ddc2a99b1 /libavformat | |
parent | 2ad8056c5e4c30c1c090eacad3d545a1e568235d (diff) | |
parent | 72fe16a13e3ebd5396ac173bf84c8b20085c16d5 (diff) | |
download | ffmpeg-35a8387b402692933620412d41e2939aca4f6935.tar.gz |
Merge commit '72fe16a13e3ebd5396ac173bf84c8b20085c16d5'
* commit '72fe16a13e3ebd5396ac173bf84c8b20085c16d5':
movenc: Use null buffers for measuring the amount of data to be written
Conflicts:
libavformat/movenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/movenc.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 276138c118..61f397b5d0 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2741,13 +2741,11 @@ static int mov_write_moof_tag(AVIOContext *pb, MOVMuxContext *mov, int tracks) { AVIOContext *avio_buf; int ret, moof_size; - uint8_t *buf; - if ((ret = avio_open_dyn_buf(&avio_buf)) < 0) + if ((ret = ffio_open_null_buf(&avio_buf)) < 0) return ret; mov_write_moof_tag_internal(avio_buf, mov, tracks, 0); - moof_size = avio_close_dyn_buf(avio_buf, &buf); - av_free(buf); + moof_size = ffio_close_null_buf(avio_buf); return mov_write_moof_tag_internal(pb, mov, tracks, moof_size); } @@ -3897,16 +3895,13 @@ static int mov_write_header(AVFormatContext *s) static int get_moov_size(AVFormatContext *s) { int ret; - uint8_t *buf; AVIOContext *moov_buf; MOVMuxContext *mov = s->priv_data; - if ((ret = avio_open_dyn_buf(&moov_buf)) < 0) + if ((ret = ffio_open_null_buf(&moov_buf)) < 0) return ret; mov_write_moov_tag(moov_buf, mov, s); - ret = avio_close_dyn_buf(moov_buf, &buf); - av_free(buf); - return ret; + return ffio_close_null_buf(moov_buf); } /* |