From 86ff85932b14fe5005e383b43365319fd741b66e Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 30 May 2007 06:11:25 +0000 Subject: * Fix for #6707 This fix is windows specific. AVIs are now evaluated by the pre-FFMPEG code first, failing that only by FFMPEG. Adding the 200 frame testfile from the bugreport http://projects.blender.org/tracker/?func=detail&aid=6707&group_id=9&atid=125 now goes fine with Add>Movie. Add>Movie+Audio will complain about the fail first, but it will be added anyway. --- source/blender/imbuf/intern/util.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index fccb3aba7fc..69390951a25 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -258,17 +258,17 @@ static int isffmpeg (char *filename) { BLI_testextensie(filename, ".wav")) return 0; if(av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL)!=0) { - fprintf(stderr, "isffmpeg: av_open_input_file failed\n"); + if(UTIL_DEBUG) fprintf(stderr, "isffmpeg: av_open_input_file failed\n"); return 0; } if(av_find_stream_info(pFormatCtx)<0) { - fprintf(stderr, "isffmpeg: av_find_stream_info failed\n"); + if(UTIL_DEBUG) fprintf(stderr, "isffmpeg: av_find_stream_info failed\n"); av_close_input_file(pFormatCtx); return 0; } - dump_format(pFormatCtx, 0, filename, 0); + if(UTIL_DEBUG) dump_format(pFormatCtx, 0, filename, 0); /* Find the first video stream */ @@ -315,19 +315,33 @@ int imb_get_anim_type(char * name) { if(UTIL_DEBUG) printf("in getanimtype: %s\n", name); -#ifdef WITH_FFMPEG +#ifndef _WIN32 +# ifdef WITH_FFMPEG /* stat test below fails on large files > 4GB */ if (isffmpeg(name)) return (ANIM_FFMPEG); -#endif +# endif + if (ib_stat(name,&st) == -1) return(0); + if (((st.st_mode) & S_IFMT) != S_IFREG) return(0); + + if (isavi(name)) return (ANIM_AVI); + if (ismovie(name)) return (ANIM_MOVIE); +# ifdef WITH_QUICKTIME + if (isqtime(name)) return (ANIM_QTIME); +# endif +#else if (ib_stat(name,&st) == -1) return(0); if (((st.st_mode) & S_IFMT) != S_IFREG) return(0); if (isavi(name)) return (ANIM_AVI); if (ismovie(name)) return (ANIM_MOVIE); -#ifdef WITH_QUICKTIME +# ifdef WITH_QUICKTIME if (isqtime(name)) return (ANIM_QTIME); +# endif +# ifdef WITH_FFMPEG + if (isffmpeg(name)) return (ANIM_FFMPEG); +# endif #endif type = IMB_ispic(name); if (type == ANIM) return (ANIM_ANIM5); -- cgit v1.2.3