Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-11-19 21:22:40 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-11-19 21:22:40 +0400
commitd0a72598373d23e8c6def4158d29c96ac73411ed (patch)
tree25b222dc76aa05a16da2399d539140bcb6990eb1 /source/blender/imbuf/intern/util.c
parentefe012eeacdf5db9fb8134026db137516d5b2e09 (diff)
Improved FFmpeg error reports when audio stream failed to be allocated
Also fixed crash using --debug-ffmpeg caused by BLI_vsnprintf modifies va_list -- need to create copy of list if this list is gonna to be reused.
Diffstat (limited to 'source/blender/imbuf/intern/util.c')
-rw-r--r--source/blender/imbuf/intern/util.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index fe138a71a4a..7cd4f47af81 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -228,6 +228,10 @@ static int isqtime(const char *name)
#ifdef WITH_FFMPEG
+#ifdef _MS_VER
+#define va_copy(dst, src) ((dst) = (src))
+#endif
+
/* BLI_vsnprintf in ffmpeg_log_callback() causes invalid warning */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-format-attribute"
@@ -237,7 +241,12 @@ static char ffmpeg_last_error[1024];
static void ffmpeg_log_callback(void *ptr, int level, const char *format, va_list arg)
{
if (ELEM(level, AV_LOG_FATAL, AV_LOG_ERROR)) {
- size_t n = BLI_vsnprintf(ffmpeg_last_error, sizeof(ffmpeg_last_error), format, arg);
+ size_t n;
+ va_list arg2;
+
+ va_copy(arg2, arg);
+
+ n = BLI_vsnprintf(ffmpeg_last_error, sizeof(ffmpeg_last_error), format, arg2);
/* strip trailing \n */
ffmpeg_last_error[n - 1] = '\0';