[Bf-blender-cvs] [efe94793c08] master: Fix T56003: Opening image files as movies in VSE crashes.

Bastien Montagne noreply at git.blender.org
Tue Jul 17 13:57:16 CEST 2018


Commit: efe94793c0854454517f49f833f688e0652f4ec0
Author: Bastien Montagne
Date:   Tue Jul 17 13:55:43 2018 +0200
Branches: master
https://developer.blender.org/rBefe94793c0854454517f49f833f688e0652f4ec0

Fix T56003: Opening image files as movies in VSE crashes.

metadata loading code was assuming all videos in Blender were from
FFMPEG... added empty place-holders for other types too, we probably
could load some metadata from pictures or AVI files too!

===================================================================

M	source/blender/imbuf/intern/anim_movie.c

===================================================================

diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index 290226acf78..9ab2ee7dd21 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -243,21 +243,35 @@ void IMB_close_anim_proxies(struct anim *anim)
 
 struct IDProperty *IMB_anim_load_metadata(struct anim *anim)
 {
+	switch (anim->curtype) {
+		case ANIM_FFMPEG:
+		{
 #ifdef WITH_FFMPEG
-	AVDictionaryEntry *entry = NULL;
+			AVDictionaryEntry *entry = NULL;
 
-	BLI_assert(anim->pFormatCtx != NULL);
-	av_log(anim->pFormatCtx, AV_LOG_DEBUG, "METADATA FETCH\n");
+			BLI_assert(anim->pFormatCtx != NULL);
+			av_log(anim->pFormatCtx, AV_LOG_DEBUG, "METADATA FETCH\n");
 
-	while (true) {
-		entry = av_dict_get(anim->pFormatCtx->metadata, "", entry, AV_DICT_IGNORE_SUFFIX);
-		if (entry == NULL) break;
+			while (true) {
+				entry = av_dict_get(anim->pFormatCtx->metadata, "", entry, AV_DICT_IGNORE_SUFFIX);
+				if (entry == NULL) break;
 
-		/* Delay creation of the property group until there is actual metadata to put in there. */
-		IMB_metadata_ensure(&anim->metadata);
-		IMB_metadata_set_field(anim->metadata, entry->key, entry->value);
-	}
+				/* Delay creation of the property group until there is actual metadata to put in there. */
+				IMB_metadata_ensure(&anim->metadata);
+				IMB_metadata_set_field(anim->metadata, entry->key, entry->value);
+			}
 #endif
+			break;
+		}
+		case ANIM_SEQUENCE:
+		case ANIM_AVI:
+		case ANIM_MOVIE:
+			/* TODO */
+			break;
+		case ANIM_NONE:
+		default:
+			break;
+	}
 	return anim->metadata;
 }



More information about the Bf-blender-cvs mailing list