diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2014-09-30 11:40:36 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-10-08 15:13:15 +0100 |
commit | b15b06ebf582ae81e47d236524c9ad6e10c8a0a7 (patch) | |
tree | 8d1bc6cdcc703ba29f4f4787a7c6945d0a5f3593 /libavformat/format.c | |
parent | 2d91abade29e43bb45c881d45909b8ee77e904e2 (diff) | |
download | ffmpeg-b15b06ebf582ae81e47d236524c9ad6e10c8a0a7.tar.gz |
avformat: use const char* instead of uint8_t* for AVProbeData.mime_type
This makes the field consistent with AVInputFormat.mime_type and the
argument type of av_match_name.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavformat/format.c')
-rw-r--r-- | libavformat/format.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/format.c b/libavformat/format.c index 11f9a52280..24b7205d44 100644 --- a/libavformat/format.c +++ b/libavformat/format.c @@ -242,6 +242,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, AVProbeData pd = { filename ? filename : "" }; uint8_t *buf = NULL; int ret = 0, probe_size; + uint8_t *mime_type_opt = NULL; if (!max_probe_size) max_probe_size = PROBE_BUF_MAX; @@ -254,8 +255,11 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, return AVERROR(EINVAL); avio_skip(pb, offset); max_probe_size -= offset; - if (pb->av_class) - av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &pd.mime_type); + if (pb->av_class) { + av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type_opt); + pd.mime_type = (const char *)mime_type_opt; + mime_type_opt = NULL; + } for (probe_size = PROBE_BUF_MIN; probe_size <= max_probe_size && !*fmt; probe_size = FFMIN(probe_size << 1, FFMAX(max_probe_size, probe_size + 1))) { @@ -301,6 +305,6 @@ fail: (ret = ffio_rewind_with_probe_data(pb, buf, pd.buf_size)) < 0) { av_free(buf); } - av_free(pd.mime_type); + av_freep(&pd.mime_type); return ret; } |