]> git.sesse.net Git - vlc/blobdiff - src/misc/image.c
Fixed bug in snapshot format
[vlc] / src / misc / image.c
index 2b45d25c32af5f4885f1eebe923092e83ad8eed5..9120f7cd112338a09efb8781daa2db12b1dad0ee 100644 (file)
@@ -71,6 +71,7 @@ static filter_t *CreateFilter( vlc_object_t *, es_format_t *,
                                video_format_t *, const char * );
 static void DeleteFilter( filter_t * );
 
+vlc_fourcc_t image_Type2Fourcc( const char * );
 vlc_fourcc_t image_Ext2Fourcc( const char * );
 /*static const char *Fourcc2Ext( vlc_fourcc_t );*/
 
@@ -534,21 +535,17 @@ static const struct
     { 0, NULL }
 };
 
-vlc_fourcc_t image_Ext2Fourcc( const char *psz_name )
+vlc_fourcc_t image_Type2Fourcc( const char *psz_type )
 {
     int i;
 
-    psz_name = strrchr( psz_name, '.' );
-    if( !psz_name ) return 0;
-    psz_name++;
-
     for( i = 0; ext_table[i].i_codec; i++ )
     {
         int j;
-        for( j = 0; toupper(ext_table[i].psz_ext[j]) == toupper(psz_name[j]);
+        for( j = 0; toupper(ext_table[i].psz_ext[j]) == toupper(psz_type[j]);
              j++ )
         {
-            if( !ext_table[i].psz_ext[j] && !psz_name[j] )
+            if( !ext_table[i].psz_ext[j] && !psz_type[j] )
                 return ext_table[i].i_codec;
         }
     }
@@ -556,6 +553,15 @@ vlc_fourcc_t image_Ext2Fourcc( const char *psz_name )
     return 0;
 }
 
+vlc_fourcc_t image_Ext2Fourcc( const char *psz_name )
+{
+    psz_name = strrchr( psz_name, '.' );
+    if( !psz_name ) return 0;
+    psz_name++;
+
+    return image_Type2Fourcc( psz_name );
+}
+
 /*
 static const char *Fourcc2Ext( vlc_fourcc_t i_codec )
 {