summaryrefslogtreecommitdiff
path: root/libavdevice/lavfi.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-04-10 20:58:15 +0100
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-04-10 20:59:55 +0100
commit6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch)
tree0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavdevice/lavfi.c
parent60b75186b2c878b6257b43c8fcc0b1356ada218e (diff)
parent9200514ad8717c63f82101dc394f4378854325bf (diff)
downloadffmpeg-6f69f7a8bf6a0d013985578df2ef42ee6b1c7994.tar.gz
Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf': 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>
Diffstat (limited to 'libavdevice/lavfi.c')
-rw-r--r--libavdevice/lavfi.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 8e9e67d3c2..a52d4730e5 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -108,8 +108,8 @@ static int create_subcc_streams(AVFormatContext *avctx)
lavfi->sink_stream_subcc_map[sink_idx] = avctx->nb_streams;
if (!(st = avformat_new_stream(avctx, NULL)))
return AVERROR(ENOMEM);
- st->codec->codec_id = AV_CODEC_ID_EIA_608;
- st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
+ st->codecpar->codec_id = AV_CODEC_ID_EIA_608;
+ st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
} else {
lavfi->sink_stream_subcc_map[sink_idx] = -1;
}
@@ -314,28 +314,28 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
for (i = 0; i < lavfi->nb_sinks; i++) {
AVFilterLink *link = lavfi->sinks[lavfi->stream_sink_map[i]]->inputs[0];
AVStream *st = avctx->streams[i];
- st->codec->codec_type = link->type;
+ st->codecpar->codec_type = link->type;
avpriv_set_pts_info(st, 64, link->time_base.num, link->time_base.den);
if (link->type == AVMEDIA_TYPE_VIDEO) {
- st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
- st->codec->pix_fmt = link->format;
- st->codec->time_base = link->time_base;
- st->codec->width = link->w;
- st->codec->height = link->h;
+ st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
+ st->codecpar->format = link->format;
+ st->avg_frame_rate = av_inv_q(link->time_base);
+ st->codecpar->width = link->w;
+ st->codecpar->height = link->h;
st ->sample_aspect_ratio =
- st->codec->sample_aspect_ratio = link->sample_aspect_ratio;
+ st->codecpar->sample_aspect_ratio = link->sample_aspect_ratio;
avctx->probesize = FFMAX(avctx->probesize,
link->w * link->h *
av_get_padded_bits_per_pixel(av_pix_fmt_desc_get(link->format)) *
30);
} else if (link->type == AVMEDIA_TYPE_AUDIO) {
- st->codec->codec_id = av_get_pcm_codec(link->format, -1);
- st->codec->channels = avfilter_link_get_channels(link);
- st->codec->sample_fmt = link->format;
- st->codec->sample_rate = link->sample_rate;
- st->codec->time_base = link->time_base;
- st->codec->channel_layout = link->channel_layout;
- if (st->codec->codec_id == AV_CODEC_ID_NONE)
+ st->codecpar->codec_id = av_get_pcm_codec(link->format, -1);
+ st->codecpar->channels = avfilter_link_get_channels(link);
+ st->codecpar->format = link->format;
+ st->codecpar->sample_rate = link->sample_rate;
+ st->avg_frame_rate = av_inv_q(link->time_base);
+ st->codecpar->channel_layout = link->channel_layout;
+ if (st->codecpar->codec_id == AV_CODEC_ID_NONE)
av_log(avctx, AV_LOG_ERROR,
"Could not find PCM codec for sample format %s.\n",
av_get_sample_fmt_name(link->format));