Merge remote-tracking branch 'qatar/master'
* qatar/master: cmutils: include shellapi.h on Win32 (for CommandLineToArgvW). x86/timer: implement an intrinsic-based version for rdtsc (AV_READ_TIME). id3v2: add a mimetype for bmp pictures. flacdec: be less strict when parsing attached pictures. flacdec: don't create an attached picture stream until we have all information. Conflicts: configure Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
ca1f2b3e10
@ -190,6 +190,7 @@ static const OptionDef *find_option(const OptionDef *po, const char *name)
|
|||||||
|
|
||||||
#if defined(_WIN32) && !defined(__MINGW32CE__)
|
#if defined(_WIN32) && !defined(__MINGW32CE__)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <shellapi.h>
|
||||||
/* Will be leaked on exit */
|
/* Will be leaked on exit */
|
||||||
static char** win32_argv_utf8 = NULL;
|
static char** win32_argv_utf8 = NULL;
|
||||||
static int win32_argc = 0;
|
static int win32_argc = 0;
|
||||||
|
3
configure
vendored
3
configure
vendored
@ -1253,6 +1253,7 @@ HAVE_LIST="
|
|||||||
poll_h
|
poll_h
|
||||||
posix_memalign
|
posix_memalign
|
||||||
pthread_cancel
|
pthread_cancel
|
||||||
|
rdtsc
|
||||||
round
|
round
|
||||||
roundf
|
roundf
|
||||||
sched_getaffinity
|
sched_getaffinity
|
||||||
@ -2947,6 +2948,8 @@ check_cc <<EOF && enable inline_asm
|
|||||||
void foo(void) { __asm__ volatile ("" ::); }
|
void foo(void) { __asm__ volatile ("" ::); }
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
check_code cc intrin.h "__rdtsc()" && enable rdtsc
|
||||||
|
|
||||||
_restrict=
|
_restrict=
|
||||||
for restrict_keyword in restrict __restrict__ __restrict; do
|
for restrict_keyword in restrict __restrict__ __restrict; do
|
||||||
check_cc <<EOF && _restrict=$restrict_keyword && break
|
check_cc <<EOF && _restrict=$restrict_keyword && break
|
||||||
|
@ -38,10 +38,6 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
|
|||||||
int type, width, height;
|
int type, width, height;
|
||||||
int len, ret = 0;
|
int len, ret = 0;
|
||||||
|
|
||||||
st = avformat_new_stream(s, NULL);
|
|
||||||
if (!st)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
|
|
||||||
pb = avio_alloc_context(buf, buf_size, 0, NULL, NULL, NULL, NULL);
|
pb = avio_alloc_context(buf, buf_size, 0, NULL, NULL, NULL, NULL);
|
||||||
if (!pb)
|
if (!pb)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
@ -50,9 +46,12 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
|
|||||||
type = avio_rb32(pb);
|
type = avio_rb32(pb);
|
||||||
if (type >= FF_ARRAY_ELEMS(ff_id3v2_picture_types) || type < 0) {
|
if (type >= FF_ARRAY_ELEMS(ff_id3v2_picture_types) || type < 0) {
|
||||||
av_log(s, AV_LOG_ERROR, "Invalid picture type: %d.\n", type);
|
av_log(s, AV_LOG_ERROR, "Invalid picture type: %d.\n", type);
|
||||||
|
if (s->error_recognition & AV_EF_EXPLODE) {
|
||||||
ret = AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
type = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* picture mimetype */
|
/* picture mimetype */
|
||||||
len = avio_rb32(pb);
|
len = avio_rb32(pb);
|
||||||
@ -60,6 +59,7 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
|
|||||||
avio_read(pb, mimetype, FFMIN(len, sizeof(mimetype) - 1)) != len) {
|
avio_read(pb, mimetype, FFMIN(len, sizeof(mimetype) - 1)) != len) {
|
||||||
av_log(s, AV_LOG_ERROR, "Could not read mimetype from an attached "
|
av_log(s, AV_LOG_ERROR, "Could not read mimetype from an attached "
|
||||||
"picture.\n");
|
"picture.\n");
|
||||||
|
if (s->error_recognition & AV_EF_EXPLODE)
|
||||||
ret = AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@ -75,6 +75,7 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
|
|||||||
if (id == CODEC_ID_NONE) {
|
if (id == CODEC_ID_NONE) {
|
||||||
av_log(s, AV_LOG_ERROR, "Unknown attached picture mimetype: %s.\n",
|
av_log(s, AV_LOG_ERROR, "Unknown attached picture mimetype: %s.\n",
|
||||||
mimetype);
|
mimetype);
|
||||||
|
if (s->error_recognition & AV_EF_EXPLODE)
|
||||||
ret = AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@ -88,6 +89,8 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (avio_read(pb, desc, len) != len) {
|
if (avio_read(pb, desc, len) != len) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "Error reading attached picture description.\n");
|
||||||
|
if (s->error_recognition & AV_EF_EXPLODE)
|
||||||
ret = AVERROR(EIO);
|
ret = AVERROR(EIO);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@ -102,6 +105,8 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
|
|||||||
/* picture data */
|
/* picture data */
|
||||||
len = avio_rb32(pb);
|
len = avio_rb32(pb);
|
||||||
if (len <= 0) {
|
if (len <= 0) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "Invalid attached picture size: %d.\n", len);
|
||||||
|
if (s->error_recognition & AV_EF_EXPLODE)
|
||||||
ret = AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@ -110,10 +115,18 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (avio_read(pb, data, len) != len) {
|
if (avio_read(pb, data, len) != len) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "Error reading attached picture data.\n");
|
||||||
|
if (s->error_recognition & AV_EF_EXPLODE)
|
||||||
ret = AVERROR(EIO);
|
ret = AVERROR(EIO);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
st = avformat_new_stream(s, NULL);
|
||||||
|
if (!st) {
|
||||||
|
ret = AVERROR(ENOMEM);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
av_init_packet(&st->attached_pic);
|
av_init_packet(&st->attached_pic);
|
||||||
st->attached_pic.data = data;
|
st->attached_pic.data = data;
|
||||||
st->attached_pic.size = len;
|
st->attached_pic.size = len;
|
||||||
|
@ -130,6 +130,7 @@ const CodecMime ff_id3v2_mime_tags[] = {
|
|||||||
{"image/jpg", CODEC_ID_MJPEG},
|
{"image/jpg", CODEC_ID_MJPEG},
|
||||||
{"image/png" , CODEC_ID_PNG},
|
{"image/png" , CODEC_ID_PNG},
|
||||||
{"image/tiff", CODEC_ID_TIFF},
|
{"image/tiff", CODEC_ID_TIFF},
|
||||||
|
{"image/bmp", CODEC_ID_BMP},
|
||||||
{"", CODEC_ID_NONE},
|
{"", CODEC_ID_NONE},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#if HAVE_INLINE_ASM
|
||||||
|
|
||||||
#define AV_READ_TIME read_time
|
#define AV_READ_TIME read_time
|
||||||
|
|
||||||
static inline uint64_t read_time(void)
|
static inline uint64_t read_time(void)
|
||||||
@ -32,4 +34,10 @@ static inline uint64_t read_time(void)
|
|||||||
return ((uint64_t)d << 32) + a;
|
return ((uint64_t)d << 32) + a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#elif HAVE_RDTSC
|
||||||
|
|
||||||
|
#define AV_READ_TIME __rdtsc
|
||||||
|
|
||||||
|
#endif /* HAVE_INLINE_ASM */
|
||||||
|
|
||||||
#endif /* AVUTIL_X86_TIMER_H */
|
#endif /* AVUTIL_X86_TIMER_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user