diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 22:58:15 +0300 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 22:59:55 +0300 |
commit | 6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch) | |
tree | 0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavformat/icodec.c | |
parent | 60b75186b2c878b6257b43c8fcc0b1356ada218e (diff) | |
parent | 9200514ad8717c63f82101dc394f4378854325bf (diff) |
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 'libavformat/icodec.c')
-rw-r--r-- | libavformat/icodec.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libavformat/icodec.c b/libavformat/icodec.c index 17acfb4b2f..8019a35f44 100644 --- a/libavformat/icodec.c +++ b/libavformat/icodec.c @@ -99,9 +99,9 @@ static int read_header(AVFormatContext *s) if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - st->codec->width = avio_r8(pb); - st->codec->height = avio_r8(pb); + st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; + st->codecpar->width = avio_r8(pb); + st->codecpar->height = avio_r8(pb); ico->images[i].nb_pal = avio_r8(pb); if (ico->images[i].nb_pal == 255) ico->images[i].nb_pal = 0; @@ -117,20 +117,20 @@ static int read_header(AVFormatContext *s) codec = avio_rl32(pb); switch (codec) { case MKTAG(0x89, 'P', 'N', 'G'): - st->codec->codec_id = AV_CODEC_ID_PNG; - st->codec->width = 0; - st->codec->height = 0; + st->codecpar->codec_id = AV_CODEC_ID_PNG; + st->codecpar->width = 0; + st->codecpar->height = 0; break; case 40: if (ico->images[i].size < 40) return AVERROR_INVALIDDATA; - st->codec->codec_id = AV_CODEC_ID_BMP; + st->codecpar->codec_id = AV_CODEC_ID_BMP; tmp = avio_rl32(pb); if (tmp) - st->codec->width = tmp; + st->codecpar->width = tmp; tmp = avio_rl32(pb); if (tmp) - st->codec->height = tmp / 2; + st->codecpar->height = tmp / 2; break; default: avpriv_request_sample(s, "codec %d", codec); @@ -157,7 +157,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) if ((ret = avio_seek(pb, image->offset, SEEK_SET)) < 0) return ret; - if (s->streams[ico->current_image]->codec->codec_id == AV_CODEC_ID_PNG) { + if (s->streams[ico->current_image]->codecpar->codec_id == AV_CODEC_ID_PNG) { if ((ret = av_get_packet(pb, pkt, image->size)) < 0) return ret; } else { @@ -177,13 +177,13 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) if ((ret = avio_read(pb, buf, image->size)) < 0) return ret; - st->codec->bits_per_coded_sample = AV_RL16(buf + 14); + st->codecpar->bits_per_coded_sample = AV_RL16(buf + 14); if (AV_RL32(buf + 32)) image->nb_pal = AV_RL32(buf + 32); - if (st->codec->bits_per_coded_sample <= 8 && !image->nb_pal) { - image->nb_pal = 1 << st->codec->bits_per_coded_sample; + if (st->codecpar->bits_per_coded_sample <= 8 && !image->nb_pal) { + image->nb_pal = 1 << st->codecpar->bits_per_coded_sample; AV_WL32(buf + 32, image->nb_pal); } |