diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2014-07-29 21:10:39 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2014-08-16 14:31:41 +0200 |
commit | a0941c8a2b3e55dc4482c874523afcb7ed6e93e6 (patch) | |
tree | 9e472048b168454605936246a7aeab4c0bade8f6 /libavformat/mlvdec.c | |
parent | c2829dc925ffcc2a5934f3e99360a89fb0a3cad5 (diff) | |
download | ffmpeg-a0941c8a2b3e55dc4482c874523afcb7ed6e93e6.tar.gz |
Use new av_dict_set_int helper function.
Get rid of the many, slightly differing, implementations
of basically the same thing.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavformat/mlvdec.c')
-rw-r--r-- | libavformat/mlvdec.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/libavformat/mlvdec.c b/libavformat/mlvdec.c index 0ed1bfaa30..1855ea46ce 100644 --- a/libavformat/mlvdec.c +++ b/libavformat/mlvdec.c @@ -95,30 +95,22 @@ static void read_string(AVFormatContext *avctx, AVIOContext *pb, const char *tag static void read_uint8(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt) { - char value[4]; - snprintf(value, sizeof(value), "%i", avio_r8(pb)); - av_dict_set(&avctx->metadata, tag, value, 0); + av_dict_set_int(&avctx->metadata, tag, avio_r8(pb), 0); } static void read_uint16(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt) { - char value[8]; - snprintf(value, sizeof(value), "%i", avio_rl16(pb)); - av_dict_set(&avctx->metadata, tag, value, 0); + av_dict_set_int(&avctx->metadata, tag, avio_rl16(pb), 0); } static void read_uint32(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt) { - char value[16]; - snprintf(value, sizeof(value), fmt, avio_rl32(pb)); - av_dict_set(&avctx->metadata, tag, value, 0); + av_dict_set_int(&avctx->metadata, tag, avio_rl32(pb), 0); } static void read_uint64(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt) { - char value[32]; - snprintf(value, sizeof(value), fmt, avio_rl64(pb)); - av_dict_set(&avctx->metadata, tag, value, 0); + av_dict_set_int(&avctx->metadata, tag, avio_rl64(pb), 0); } static int scan_file(AVFormatContext *avctx, AVStream *vst, AVStream *ast, int file) |