]> git.sesse.net Git - vlc/commitdiff
Added support for AVI with out of spec idx1 index.
authorLaurent Aimar <fenrir@videolan.org>
Fri, 7 Oct 2011 19:52:42 +0000 (21:52 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Fri, 7 Oct 2011 20:26:17 +0000 (22:26 +0200)
It closes #5389.

modules/demux/avi/avi.c

index 4e1e5065ee00874864064a27fdfdd39b110a6d90..7096d8d2efbafa7dc3de64ff6060756f355661dc 100644 (file)
@@ -95,6 +95,8 @@ static char *FromACP( const char *str )
     return FromCharset(vlc_pgettext("GetACP", "CP1252"), str, strlen(str));
 }
 
+#define IGNORE_ES NAV_ES
+
 typedef struct
 {
     vlc_fourcc_t i_fourcc;
@@ -1951,6 +1953,9 @@ static void AVI_ParseStreamHeader( vlc_fourcc_t i_id,
             case AVITWOCC_sb:
                 SET_PTR( pi_type, SPU_ES );
                 break;
+            case AVITWOCC_pc:
+                SET_PTR( pi_type, IGNORE_ES );
+                break;
             default:
                 SET_PTR( pi_type, UNKNOWN_ES );
                 break;
@@ -2181,7 +2186,7 @@ static int AVI_IndexLoad_idx1( demux_t *p_demux,
                                &i_stream,
                                &i_cat );
         if( i_stream < p_sys->i_track &&
-            i_cat == p_sys->track[i_stream]->i_cat )
+            (i_cat == p_sys->track[i_stream]->i_cat || i_cat == UNKNOWN_ES ) )
         {
             avi_entry_t index;
             index.i_id     = p_idx1->entry[i_index].i_fourcc;