diff options
Diffstat (limited to 'libavformat/ivfenc.c')
-rw-r--r-- | libavformat/ivfenc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c index 490b0a921a..5dbcd97611 100644 --- a/libavformat/ivfenc.c +++ b/libavformat/ivfenc.c @@ -28,25 +28,25 @@ typedef struct IVFEncContext { static int ivf_write_header(AVFormatContext *s) { - AVCodecContext *ctx; + AVCodecParameters *par; AVIOContext *pb = s->pb; if (s->nb_streams != 1) { av_log(s, AV_LOG_ERROR, "Format supports only exactly one video stream\n"); return AVERROR(EINVAL); } - ctx = s->streams[0]->codec; - if (ctx->codec_type != AVMEDIA_TYPE_VIDEO || - !(ctx->codec_id == AV_CODEC_ID_VP8 || ctx->codec_id == AV_CODEC_ID_VP9)) { + par = s->streams[0]->codecpar; + if (par->codec_type != AVMEDIA_TYPE_VIDEO || + !(par->codec_id == AV_CODEC_ID_VP8 || par->codec_id == AV_CODEC_ID_VP9)) { av_log(s, AV_LOG_ERROR, "Currently only VP8 and VP9 are supported!\n"); return AVERROR(EINVAL); } avio_write(pb, "DKIF", 4); avio_wl16(pb, 0); // version avio_wl16(pb, 32); // header length - avio_wl32(pb, ctx->codec_tag ? ctx->codec_tag : ctx->codec_id == AV_CODEC_ID_VP9 ? AV_RL32("VP90") : AV_RL32("VP80")); - avio_wl16(pb, ctx->width); - avio_wl16(pb, ctx->height); + avio_wl32(pb, par->codec_tag ? par->codec_tag : par->codec_id == AV_CODEC_ID_VP9 ? AV_RL32("VP90") : AV_RL32("VP80")); + avio_wl16(pb, par->width); + avio_wl16(pb, par->height); avio_wl32(pb, s->streams[0]->time_base.den); avio_wl32(pb, s->streams[0]->time_base.num); avio_wl64(pb, 0xFFFFFFFFFFFFFFFFULL); @@ -91,7 +91,7 @@ static int ivf_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt) int ret = 1; AVStream *st = s->streams[pkt->stream_index]; - if (st->codec->codec_id == AV_CODEC_ID_VP9) + if (st->codecpar->codec_id == AV_CODEC_ID_VP9) ret = ff_stream_add_bitstream_filter(st, "vp9_superframe", NULL); return ret; |