diff options
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); } |