@ -28,15 +28,15 @@
# define RAW_SAMPLES 1024
typedef struct Raw AudioDemuxerContext {
typedef struct PCM AudioDemuxerContext {
AVClass * class ;
int sample_rate ;
int channels ;
} Raw AudioDemuxerContext;
} PCM AudioDemuxerContext;
static int raw _read_header( AVFormatContext * s )
static int pcm _read_header( AVFormatContext * s )
{
Raw AudioDemuxerContext * s1 = s - > priv_data ;
PCM AudioDemuxerContext * s1 = s - > priv_data ;
AVStream * st ;
st = avformat_new_stream ( s , NULL ) ;
@ -61,7 +61,7 @@ static int raw_read_header(AVFormatContext *s)
return 0 ;
}
static int raw _read_packet( AVFormatContext * s , AVPacket * pkt )
static int pcm _read_packet( AVFormatContext * s , AVPacket * pkt )
{
int ret , size , bps ;
// AVStream *st = s->streams[0];
@ -84,8 +84,8 @@ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
}
static const AVOption pcm_options [ ] = {
{ " sample_rate " , " " , offsetof ( Raw AudioDemuxerContext, sample_rate ) , AV_OPT_TYPE_INT , { . i64 = 44100 } , 0 , INT_MAX , AV_OPT_FLAG_DECODING_PARAM } ,
{ " channels " , " " , offsetof ( Raw AudioDemuxerContext, channels ) , AV_OPT_TYPE_INT , { . i64 = 1 } , 0 , INT_MAX , AV_OPT_FLAG_DECODING_PARAM } ,
{ " sample_rate " , " " , offsetof ( PCM AudioDemuxerContext, sample_rate ) , AV_OPT_TYPE_INT , { . i64 = 44100 } , 0 , INT_MAX , AV_OPT_FLAG_DECODING_PARAM } ,
{ " channels " , " " , offsetof ( PCM AudioDemuxerContext, channels ) , AV_OPT_TYPE_INT , { . i64 = 1 } , 0 , INT_MAX , AV_OPT_FLAG_DECODING_PARAM } ,
{ NULL } ,
} ;
@ -99,9 +99,9 @@ static const AVClass name_ ## _demuxer_class = { \
AVInputFormat ff_pcm_ # # name_ # # _demuxer = { \
. name = # name_ , \
. long_name = NULL_IF_CONFIG_SMALL ( long_name_ ) , \
. priv_data_size = sizeof ( Raw AudioDemuxerContext) , \
. read_header = raw _read_header, \
. read_packet = raw _read_packet, \
. priv_data_size = sizeof ( PCM AudioDemuxerContext) , \
. read_header = pcm _read_header, \
. read_packet = pcm _read_packet, \
. read_seek = ff_pcm_read_seek , \
. flags = AVFMT_GENERIC_INDEX , \
. extensions = ext , \