/*****************************************************************************
* au.c : au file input module for vlc
*****************************************************************************
- * Copyright (C) 2001-2003 VideoLAN (Centrale Réseaux) and its contributors
+ * Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
#include <stdlib.h> /* malloc(), free() */
#include <vlc/vlc.h>
-#include <vlc/input.h>
+#include <vlc_demux.h>
/* TODO:
* - all adpcm things (I _NEED_ samples)
int i_header_size;
};
-static int DemuxPCM( demux_t * );
+static int Demux( demux_t * );
static int Control ( demux_t *, int i_query, va_list args );
/*****************************************************************************
demux_sys_t *p_sys;
uint8_t hdr[20];
- uint8_t *p_peek;
+ const uint8_t *p_peek;
int i_cat;
int i_samples, i_modulo;
- if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 ) return VLC_EGENERIC;
+ CHECK_PEEK( p_peek, 4 );
- if( strncmp( p_peek, ".snd", 4 ) )
+ if( memcmp( p_peek, ".snd", 4 ) )
{
return VLC_EGENERIC;
}
return VLC_EGENERIC;
}
- p_sys = p_demux->p_sys = malloc( sizeof( demux_sys_t ) );
+ STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys;
p_sys->i_time = 1;
p_sys->i_header_size = GetDWBE( &hdr[0] );
(mtime_t)i_samples /
(mtime_t)p_sys->fmt.audio.i_rate;
- /* finish to set up p_demux */
- p_demux->pf_demux = DemuxPCM;
- p_demux->pf_control = Control;
-
return VLC_SUCCESS;
}
/*****************************************************************************
- * DemuxPCM: read packet and send them to decoders
+ * Demux: read packet and send them to decoders
*****************************************************************************
* Returns -1 in case of error, 0 in case of EOF, 1 otherwise
*****************************************************************************/
-static int DemuxPCM( demux_t *p_demux )
+static int Demux( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
block_t *p_block;