Commit 777d8f6f authored by Laurent Aimar's avatar Laurent Aimar

Hacks for On2 AVI files (close #1318)

parent 02b93c53
...@@ -232,8 +232,10 @@ static int Open( vlc_object_t * p_this ) ...@@ -232,8 +232,10 @@ static int Open( vlc_object_t * p_this )
for( i_peeker = 0; i_peeker < 188; i_peeker++ ) for( i_peeker = 0; i_peeker < 188; i_peeker++ )
{ {
if( !strncmp( (char *)&p_peek[0], "RIFF", 4 ) && if( !strncmp( (char *)&p_peek[0], "RIFF", 4 ) && !strncmp( (char *)&p_peek[8], "AVI ", 4 ) )
!strncmp( (char *)&p_peek[8], "AVI ", 4 ) ) break; break;
if( !strncmp( (char *)&p_peek[0], "ON2 ", 4 ) && !strncmp( (char *)&p_peek[8], "ON2f", 4 ) )
break;
p_peek++; p_peek++;
} }
if( i_peeker == 188 ) if( i_peeker == 188 )
......
...@@ -130,6 +130,13 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container ) ...@@ -130,6 +130,13 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container )
p_container->list.i_type = GetFOURCC( p_peek + 8 ); p_container->list.i_type = GetFOURCC( p_peek + 8 );
/* XXX fixed for on2 hack */
if( p_container->common.i_chunk_fourcc == AVIFOURCC_ON2 && p_container->list.i_type == AVIFOURCC_ON2f )
{
p_container->common.i_chunk_fourcc = AVIFOURCC_RIFF;
p_container->list.i_type = AVIFOURCC_AVI;
}
if( p_container->common.i_chunk_fourcc == AVIFOURCC_LIST && if( p_container->common.i_chunk_fourcc == AVIFOURCC_LIST &&
p_container->list.i_type == AVIFOURCC_movi ) p_container->list.i_type == AVIFOURCC_movi )
{ {
...@@ -246,6 +253,7 @@ static int AVI_ChunkRead_avih( stream_t *s, avi_chunk_t *p_chk ) ...@@ -246,6 +253,7 @@ static int AVI_ChunkRead_avih( stream_t *s, avi_chunk_t *p_chk )
{ {
AVI_READCHUNK_ENTER; AVI_READCHUNK_ENTER;
p_chk->common.i_chunk_fourcc = AVIFOURCC_avih;
AVI_READ4BYTES( p_chk->avih.i_microsecperframe); AVI_READ4BYTES( p_chk->avih.i_microsecperframe);
AVI_READ4BYTES( p_chk->avih.i_maxbytespersec ); AVI_READ4BYTES( p_chk->avih.i_maxbytespersec );
AVI_READ4BYTES( p_chk->avih.i_reserved1 ); AVI_READ4BYTES( p_chk->avih.i_reserved1 );
...@@ -650,8 +658,10 @@ static struct ...@@ -650,8 +658,10 @@ static struct
} AVI_Chunk_Function [] = } AVI_Chunk_Function [] =
{ {
{ AVIFOURCC_RIFF, AVI_ChunkRead_list, AVI_ChunkFree_nothing }, { AVIFOURCC_RIFF, AVI_ChunkRead_list, AVI_ChunkFree_nothing },
{ AVIFOURCC_ON2, AVI_ChunkRead_list, AVI_ChunkFree_nothing },
{ AVIFOURCC_LIST, AVI_ChunkRead_list, AVI_ChunkFree_nothing }, { AVIFOURCC_LIST, AVI_ChunkRead_list, AVI_ChunkFree_nothing },
{ AVIFOURCC_avih, AVI_ChunkRead_avih, AVI_ChunkFree_nothing }, { AVIFOURCC_avih, AVI_ChunkRead_avih, AVI_ChunkFree_nothing },
{ AVIFOURCC_ON2h, AVI_ChunkRead_avih, AVI_ChunkFree_nothing },
{ AVIFOURCC_strh, AVI_ChunkRead_strh, AVI_ChunkFree_nothing }, { AVIFOURCC_strh, AVI_ChunkRead_strh, AVI_ChunkFree_nothing },
{ AVIFOURCC_strf, AVI_ChunkRead_strf, AVI_ChunkFree_strf }, { AVIFOURCC_strf, AVI_ChunkRead_strf, AVI_ChunkFree_strf },
{ AVIFOURCC_strd, AVI_ChunkRead_strd, AVI_ChunkFree_strd }, { AVIFOURCC_strd, AVI_ChunkRead_strd, AVI_ChunkFree_strd },
...@@ -792,7 +802,8 @@ static void AVI_ChunkDumpDebug_level( vlc_object_t *p_obj, ...@@ -792,7 +802,8 @@ static void AVI_ChunkDumpDebug_level( vlc_object_t *p_obj,
{ {
str[i * 5] = '|'; str[i * 5] = '|';
} }
if( p_chk->common.i_chunk_fourcc == AVIFOURCC_RIFF|| if( p_chk->common.i_chunk_fourcc == AVIFOURCC_RIFF ||
p_chk->common.i_chunk_fourcc == AVIFOURCC_ON2 ||
p_chk->common.i_chunk_fourcc == AVIFOURCC_LIST ) p_chk->common.i_chunk_fourcc == AVIFOURCC_LIST )
{ {
sprintf( str + i_level * 5, sprintf( str + i_level * 5,
......
...@@ -234,14 +234,17 @@ void AVI_ChunkFreeRoot( stream_t *, avi_chunk_t *p_chk ); ...@@ -234,14 +234,17 @@ void AVI_ChunkFreeRoot( stream_t *, avi_chunk_t *p_chk );
/* *** avi stuff *** */ /* *** avi stuff *** */
#define AVIFOURCC_RIFF VLC_FOURCC('R','I','F','F') #define AVIFOURCC_RIFF VLC_FOURCC('R','I','F','F')
#define AVIFOURCC_ON2 VLC_FOURCC('O','N','2',' ')
#define AVIFOURCC_LIST VLC_FOURCC('L','I','S','T') #define AVIFOURCC_LIST VLC_FOURCC('L','I','S','T')
#define AVIFOURCC_JUNK VLC_FOURCC('J','U','N','K') #define AVIFOURCC_JUNK VLC_FOURCC('J','U','N','K')
#define AVIFOURCC_AVI VLC_FOURCC('A','V','I',' ') #define AVIFOURCC_AVI VLC_FOURCC('A','V','I',' ')
#define AVIFOURCC_AVIX VLC_FOURCC('A','V','I','X') #define AVIFOURCC_AVIX VLC_FOURCC('A','V','I','X')
#define AVIFOURCC_ON2f VLC_FOURCC('O','N','2','f')
#define AVIFOURCC_WAVE VLC_FOURCC('W','A','V','E') #define AVIFOURCC_WAVE VLC_FOURCC('W','A','V','E')
#define AVIFOURCC_INFO VLC_FOURCC('I','N','F','O') #define AVIFOURCC_INFO VLC_FOURCC('I','N','F','O')
#define AVIFOURCC_avih VLC_FOURCC('a','v','i','h') #define AVIFOURCC_avih VLC_FOURCC('a','v','i','h')
#define AVIFOURCC_ON2h VLC_FOURCC('O','N','2','h')
#define AVIFOURCC_hdrl VLC_FOURCC('h','d','r','l') #define AVIFOURCC_hdrl VLC_FOURCC('h','d','r','l')
#define AVIFOURCC_movi VLC_FOURCC('m','o','v','i') #define AVIFOURCC_movi VLC_FOURCC('m','o','v','i')
#define AVIFOURCC_idx1 VLC_FOURCC('i','d','x','1') #define AVIFOURCC_idx1 VLC_FOURCC('i','d','x','1')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment