Commit 737d7677 authored by Laurent Aimar's avatar Laurent Aimar

* plugins/avi/avi.c : changed in order to read more avi file, Meuuh

you can now read your file ;) (but audio is awfull,perhaps because of mad
plugin ? ). Fix a bug for audio with some avi file.
parent 77b358ea
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* avi.h : AVI file Stream input module for vlc * avi.h : AVI file Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: avi.h,v 1.2 2002/04/25 21:52:42 sam Exp $ * $Id: avi.h,v 1.3 2002/04/30 12:35:24 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#define MAX_PACKETS_IN_FIFO 10 #define MAX_PACKETS_IN_FIFO 2
/* flags for use in <dwFlags> in AVIFileHdr */ /* flags for use in <dwFlags> in AVIFileHdr */
#define AVIF_HASINDEX 0x00000010 /* Index at end of file? */ #define AVIF_HASINDEX 0x00000010 /* Index at end of file? */
...@@ -130,31 +130,34 @@ typedef struct AVIStreamInfo_s ...@@ -130,31 +130,34 @@ typedef struct AVIStreamInfo_s
bitmapinfoheader_t video_format; bitmapinfoheader_t video_format;
waveformatex_t audio_format; waveformatex_t audio_format;
es_descriptor_t *p_es; es_descriptor_t *p_es;
int b_unselected; /* previously unselected */ int b_selected; /* newly selected */
AVIIndexEntry_t *p_index; AVIIndexEntry_t *p_index;
int i_idxnb; int i_idxnb;
int i_idxmax; int i_idxmax;
int i_idxpos; int i_idxposc; /* numero of chunk */
int i_idxposb; /* byte in the current chunk */
off_t i_idxoffset; /* how many to add to index.i_pos */ off_t i_idxoffset; /* how many to add to index.i_pos */
} AVIStreamInfo_t; } AVIStreamInfo_t;
typedef struct demux_data_avi_file_s typedef struct demux_data_avi_file_s
{ {
mtime_t i_date; /* date correspondant i_chunkread = 0 */ mtime_t i_date;
riffchunk_t *p_riff; riffchunk_t *p_riff;
riffchunk_t *p_hdrl; riffchunk_t *p_hdrl;
riffchunk_t *p_movi; riffchunk_t *p_movi;
riffchunk_t *p_idx1; riffchunk_t *p_idx1;
/* Info extraites de avih */ /* Info extrated from avih */
MainAVIHeader_t avih; MainAVIHeader_t avih;
/* les differents stream */ /* number of stream and informations*/
int i_streams; int i_streams;
AVIStreamInfo_t **pp_info; AVIStreamInfo_t **pp_info;
/* absolument pas definitif */ /* current audio and video es */
AVIStreamInfo_t *p_info_video;
AVIStreamInfo_t *p_info_audio;
} demux_data_avi_file_t; } demux_data_avi_file_t;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libioRIFF.c : AVI file Stream input module for vlc * libioRIFF.c : AVI file Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: libioRIFF.c,v 1.1 2002/04/23 23:44:36 fenrir Exp $ * $Id: libioRIFF.c,v 1.2 2002/04/30 12:35:24 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -294,11 +294,18 @@ static int RIFF_LoadChunkData(input_thread_t * p_input,riffchunk_t *p_riff ) ...@@ -294,11 +294,18 @@ static int RIFF_LoadChunkData(input_thread_t * p_input,riffchunk_t *p_riff )
return( 0 ); return( 0 );
} }
static int RIFF_LoadChunkDataInPES(input_thread_t * p_input,riffchunk_t *p_riff,pes_packet_t **pp_pes) static int RIFF_LoadChunkDataInPES(input_thread_t * p_input,
pes_packet_t **pp_pes)
{ {
u32 i_read; u32 i_read;
data_packet_t *p_data; data_packet_t *p_data;
riffchunk_t *p_riff;
if( (p_riff = RIFF_ReadChunk( p_input )) == NULL )
{
*pp_pes = NULL;
return( -1 );
}
RIFF_GoToChunkData(p_input); RIFF_GoToChunkData(p_input);
*pp_pes = input_NewPES( p_input->p_method_data ); *pp_pes = input_NewPES( p_input->p_method_data );
......
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