== AVI ==

Only open AVI files with at least one supported video track type.
(This is the real fix for DV-Type1-AVIs, since the FCC of iads, that
is used there, wasn't detected. But the code will happily open AVI-files
with only audio tracks... So the real fix is: only try to open things, that
contains something we know how to handle :) )
This commit is contained in:
Peter Schlaile 2009-06-21 17:00:18 +00:00
parent 4dec9f3cb6
commit 29c6440bb3

@ -214,6 +214,7 @@ int AVI_is_avi (char *name) {
AviMovie movie; AviMovie movie;
AviMainHeader header; AviMainHeader header;
AviBitmapInfoHeader bheader; AviBitmapInfoHeader bheader;
int movie_tracks = 0;
DEBUG("opening movie\n"); DEBUG("opening movie\n");
@ -303,6 +304,7 @@ int AVI_is_avi (char *name) {
fclose(movie.fp); fclose(movie.fp);
return 0; return 0;
} }
movie_tracks++;
} }
movie.streams[temp].sh.Flags = GET_FCC (movie.fp); movie.streams[temp].sh.Flags = GET_FCC (movie.fp);
@ -394,7 +396,10 @@ int AVI_is_avi (char *name) {
MEM_freeN(movie.streams); MEM_freeN(movie.streams);
fclose(movie.fp); fclose(movie.fp);
return 1;
/* at least one video track is needed */
return (movie_tracks != 0);
} }
AviError AVI_open_movie (char *name, AviMovie *movie) { AviError AVI_open_movie (char *name, AviMovie *movie) {