aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/img2enc.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 /libavformat/img2enc.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 'libavformat/img2enc.c')
-rw-r--r--libavformat/img2enc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index ebbac2bf7b..32c68e4d10 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -50,7 +50,7 @@ static int write_header(AVFormatContext *s)
{
VideoMuxData *img = s->priv_data;
AVStream *st = s->streams[0];
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(st->codec->pix_fmt);
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(st->codecpar->format);
av_strlcpy(img->path, s->filename, sizeof(img->path));
@@ -60,9 +60,9 @@ static int write_header(AVFormatContext *s)
else
img->is_pipe = 1;
- if (st->codec->codec_id == AV_CODEC_ID_GIF) {
+ if (st->codecpar->codec_id == AV_CODEC_ID_GIF) {
img->muxer = "gif";
- } else if (st->codec->codec_id == AV_CODEC_ID_RAWVIDEO) {
+ } else if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) {
const char *str = strrchr(img->path, '.');
img->split_planes = str
&& !av_strcasecmp(str + 1, "y")
@@ -80,8 +80,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
VideoMuxData *img = s->priv_data;
AVIOContext *pb[4];
char filename[1024];
- AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(codec->pix_fmt);
+ AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar;
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(par->format);
int i;
int nb_renames = 0;
@@ -123,8 +123,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
}
if (img->split_planes) {
- int ysize = codec->width * codec->height;
- int usize = AV_CEIL_RSHIFT(codec->width, desc->log2_chroma_w) * AV_CEIL_RSHIFT(codec->height, desc->log2_chroma_h);
+ int ysize = par->width * par->height;
+ int usize = AV_CEIL_RSHIFT(par->width, desc->log2_chroma_w) * AV_CEIL_RSHIFT(par->height, desc->log2_chroma_h);
if (desc->comp[0].depth >= 9) {
ysize *= 2;
usize *= 2;
@@ -159,7 +159,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
fmt->pb = pb[0];
if ((ret = av_copy_packet(&pkt2, pkt)) < 0 ||
(ret = av_dup_packet(&pkt2)) < 0 ||
- (ret = avcodec_copy_context(st->codec, s->streams[0]->codec)) < 0 ||
+ (ret = avcodec_parameters_copy(st->codecpar, s->streams[0]->codecpar)) < 0 ||
(ret = avformat_write_header(fmt, NULL)) < 0 ||
(ret = av_interleaved_write_frame(fmt, &pkt2)) < 0 ||
(ret = av_write_trailer(fmt)) < 0) {