st->codec.codec_type = CODEC_TYPE_AUDIO; st->codec.codec_id = s->codec_id; st->codec.sample_rate = s->sample_rate; st->codec.channels = s->channels;
st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = s->codec_id; st->codec->sample_rate = s->sample_rate; st->codec->channels = s->channels;
static int audio_read_header(AVFormatContext *s1, AVFormatParameters *ap){    AudioData *s = (AudioData *)s1->priv_data;    AVStream *st;    int ret;    if (!ap || ap->sample_rate <= 0 || ap->channels <= 0)        return -1;    st = av_new_stream(s1, 0);    if (!st) {        return -ENOMEM;    }    s->sample_rate = ap->sample_rate;    s->channels = ap->channels;    ret = audio_open(s, 0, ap->device);    if (ret < 0) {        av_free(st);        return -EIO;    }    /* take real parameters */    st->codec.codec_type = CODEC_TYPE_AUDIO;    st->codec.codec_id = s->codec_id;    st->codec.sample_rate = s->sample_rate;    st->codec.channels = s->channels;    return 0;    av_set_pts_info(s1, 48, 1, 1000000);  /* 48 bits pts in us */}