* commit '9200514ad8':
  lavf: replace AVStream.codec with AVStream.codecpar

This has been a HUGE effort from:
    - Derek Buitenhuis <derek.buitenhuis@gmail.com>
    - Hendrik Leppkes <h.leppkes@gmail.com>
    - wm4 <nfxjfg@googlemail.com>
    - Clément Bœsch <clement@stupeflix.com>
    - James Almer <jamrial@gmail.com>
    - Michael Niedermayer <michael@niedermayer.cc>
    - Rostislav Pehlivanov <atomnuker@gmail.com>

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
Derek Buitenhuis 2016-04-10 20:58:15 +01:00
commit 6f69f7a8bf
362 changed files with 6553 additions and 6077 deletions

View file

@ -52,8 +52,8 @@ static int flac_read_header(AVFormatContext *s)
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_FLAC;
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->codec_id = AV_CODEC_ID_FLAC;
st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
/* the parameters will be extracted from the compressed bitstream */
@ -102,14 +102,14 @@ static int flac_read_header(AVFormatContext *s)
RETURN_ERROR(AVERROR_INVALIDDATA);
}
found_streaminfo = 1;
st->codec->extradata = buffer;
st->codec->extradata_size = metadata_size;
st->codecpar->extradata = buffer;
st->codecpar->extradata_size = metadata_size;
buffer = NULL;
/* get sample rate and sample count from STREAMINFO header;
* other parameters will be extracted by the parser */
samplerate = AV_RB24(st->codec->extradata + 10) >> 4;
samples = (AV_RB64(st->codec->extradata + 13) >> 24) & ((1ULL << 36) - 1);
samplerate = AV_RB24(st->codecpar->extradata + 10) >> 4;
samples = (AV_RB64(st->codecpar->extradata + 13) >> 24) & ((1ULL << 36) - 1);
/* set time base and duration */
if (samplerate > 0) {
@ -189,7 +189,7 @@ static int flac_read_header(AVFormatContext *s)
av_log(s, AV_LOG_WARNING,
"Invalid value of WAVEFORMATEXTENSIBLE_CHANNEL_MASK\n");
} else {
st->codec->channel_layout = mask;
st->codecpar->channel_layout = mask;
av_dict_set(&s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", NULL, 0);
}
}
@ -248,7 +248,7 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde
return AV_NOPTS_VALUE;
av_init_packet(&pkt);
parser = av_parser_init(st->codec->codec_id);
parser = av_parser_init(st->codecpar->codec_id);
if (!parser){
return AV_NOPTS_VALUE;
}
@ -263,7 +263,7 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde
break;
}
av_init_packet(&out_pkt);
av_parser_parse2(parser, st->codec,
av_parser_parse2(parser, st->internal->avctx,
&out_pkt.data, &out_pkt.size, pkt.data, pkt.size,
pkt.pts, pkt.dts, *ppos);