Commit 124fa2e9 authored by Laurent Aimar's avatar Laurent Aimar

*all : now can find key frame even with broken avi.

parent fe41bed6
This diff is collapsed.
......@@ -2,7 +2,7 @@
* avi.h : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: avi.h,v 1.7 2002/06/26 23:11:12 fenrir Exp $
* $Id: avi.h,v 1.8 2002/06/30 15:07:57 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -36,6 +36,10 @@
#define AVIIF_NOTIME 0x00000100L /* this frame doesn't take any time */
#define AVIIF_COMPUSE 0x0FFF0000L /* these bits are for compressor use */
#define AVIIF_FIXKEYFRAME 0x00001000L /* invented; used to say that
the keyframe flag isn't a true flag
but have to be verified */
/* Sound formats */
#define WAVE_FORMAT_UNKNOWN 0x0000
#define WAVE_FORMAT_PCM 0x0001
......
......@@ -2,7 +2,7 @@
* libioRIFF.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libioRIFF.c,v 1.10 2002/06/30 03:51:29 fenrir Exp $
* $Id: libioRIFF.c,v 1.11 2002/06/30 15:07:57 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -119,8 +119,8 @@ riffchunk_t * RIFF_ReadChunk(input_thread_t * p_input)
}
p_riff->p_data = NULL;
/* peek to have the begining, 8+4 where 4 are to get type */
if( ( count = input_Peek( p_input, &p_peek, 12 ) ) < 8 )
/* peek to have the begining, 8+8 get i_8bytes */
if( ( count = input_Peek( p_input, &p_peek, 16 ) ) < 8 )
{
msg_Err( p_input, "cannot peek()" );
free(p_riff);
......@@ -129,8 +129,12 @@ riffchunk_t * RIFF_ReadChunk(input_thread_t * p_input)
p_riff->i_id = __GetDWLE( p_peek );
p_riff->i_size =__GetDWLE( p_peek + 4 );
p_riff->i_type = ( count == 12 ) ? __GetDWLE( p_peek + 8 ) : 0 ;
p_riff->i_type = ( count >= 12 ) ? __GetDWLE( p_peek + 8 ) : 0 ;
memset( &p_riff->i_8bytes, 8, 0 );
if( count >= 12 )
{
memcpy( &p_riff->i_8bytes, p_peek + 8, count - 8 );
}
__RIFF_TellPos(p_input, &(p_riff->i_pos) );
return( p_riff );
......
......@@ -2,7 +2,7 @@
* libioRIFF.h : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libioRIFF.h,v 1.1 2002/06/26 23:11:12 fenrir Exp $
* $Id: libioRIFF.h,v 1.2 2002/06/30 15:07:57 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -27,6 +27,8 @@ typedef struct riffchunk_s
u32 i_type;
u32 i_pos;
data_packet_t *p_data;
u64 i_8bytes; /* it's the first 8 bytes after header
used for key frame generation */
} riffchunk_t;
int __RIFF_TellPos( input_thread_t *p_input, u32 *pos );
......@@ -41,9 +43,10 @@ int RIFF_FindChunk(input_thread_t * p_input,
int RIFF_GoToChunkData(input_thread_t * p_input);
int RIFF_LoadChunkData(input_thread_t * p_input,
riffchunk_t *p_riff );
int RIFF_LoadChunkDataInPES(input_thread_t * p_input,
pes_packet_t **pp_pes,
int i_size_index);
int RIFF_LoadChunkDataInPES(input_thread_t * p_input,
pes_packet_t **pp_pes,
int i_size_index);
int RIFF_GoToChunk(input_thread_t * p_input,
riffchunk_t *p_riff);
int RIFF_TestFileHeader( input_thread_t * p_input,
......
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