diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-08 21:35:40 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-08 21:35:40 +0200 |
commit | 911ba8fb197dee6fb1dd4ac2d1fa2d8541ab6ab5 (patch) | |
tree | b705257eab737a868ee064e95bd97d51e13785d3 | |
parent | be695ee389724d713e1b8a61ef899fe1795193ce (diff) | |
parent | b15b06ebf582ae81e47d236524c9ad6e10c8a0a7 (diff) | |
download | ffmpeg-911ba8fb197dee6fb1dd4ac2d1fa2d8541ab6ab5.tar.gz |
Merge commit 'b15b06ebf582ae81e47d236524c9ad6e10c8a0a7'
* commit 'b15b06ebf582ae81e47d236524c9ad6e10c8a0a7':
avformat: use const char* instead of uint8_t* for AVProbeData.mime_type
Conflicts:
libavformat/format.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/avformat.h | 2 | ||||
-rw-r--r-- | libavformat/format.c | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index f189741af6..9c545c08d0 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -398,7 +398,7 @@ typedef struct AVProbeData { const char *filename; unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */ int buf_size; /**< Size of buf except extra allocated bytes */ - uint8_t *mime_type; /**< mime_type, when known. */ + const char *mime_type; /**< mime_type, when known. */ } AVProbeData; #define AVPROBE_SCORE_RETRY (AVPROBE_SCORE_MAX/4) diff --git a/libavformat/format.c b/libavformat/format.c index 2d56e6d545..527299d652 100644 --- a/libavformat/format.c +++ b/libavformat/format.c @@ -243,6 +243,7 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt, int ret = 0, probe_size, buf_offset = 0; int score = 0; int ret2; + uint8_t *mime_type_opt = NULL; if (!max_probe_size) max_probe_size = PROBE_BUF_MAX; @@ -255,8 +256,11 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt, if (offset >= max_probe_size) return AVERROR(EINVAL); - 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; + } #if 0 if (!*fmt && pb->av_class && av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type) >= 0 && mime_type) { if (!av_strcasecmp(mime_type, "audio/aacp")) { @@ -320,7 +324,7 @@ fail: if (ret >= 0) ret = ret2; - av_free(pd.mime_type); + av_freep(&pd.mime_type); return ret < 0 ? ret : score; } |