diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 20:58:15 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 20:59:55 +0100 |
commit | 6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch) | |
tree | 0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavformat/rawutils.c | |
parent | 60b75186b2c878b6257b43c8fcc0b1356ada218e (diff) | |
parent | 9200514ad8717c63f82101dc394f4378854325bf (diff) | |
download | ffmpeg-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/rawutils.c')
-rw-r--r-- | libavformat/rawutils.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libavformat/rawutils.c b/libavformat/rawutils.c index 26ebbb5629..996412adb9 100644 --- a/libavformat/rawutils.c +++ b/libavformat/rawutils.c @@ -22,30 +22,30 @@ #include "avformat.h" #include "internal.h" -int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecContext *enc, int expected_stride) +int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecParameters *par, int expected_stride) { int ret; AVPacket *pkt = *ppkt; - int64_t bpc = enc->bits_per_coded_sample != 15 ? enc->bits_per_coded_sample : 16; - int min_stride = (enc->width * bpc + 7) >> 3; - int with_pal_size = min_stride * enc->height + 1024; + int64_t bpc = par->bits_per_coded_sample != 15 ? par->bits_per_coded_sample : 16; + int min_stride = (par->width * bpc + 7) >> 3; + int with_pal_size = min_stride * par->height + 1024; int contains_pal = bpc == 8 && pkt->size == with_pal_size; - int size = contains_pal ? min_stride * enc->height : pkt->size; - int stride = size / enc->height; + int size = contains_pal ? min_stride * par->height : pkt->size; + int stride = size / par->height; int padding = expected_stride - FFMIN(expected_stride, stride); int y; AVPacket *new_pkt; - if (pkt->size == expected_stride * enc->height) + if (pkt->size == expected_stride * par->height) return 0; - if (size != stride * enc->height) + if (size != stride * par->height) return 0; new_pkt = av_packet_alloc(); if (!new_pkt) return AVERROR(ENOMEM); - ret = av_new_packet(new_pkt, expected_stride * enc->height); + ret = av_new_packet(new_pkt, expected_stride * par->height); if (ret < 0) goto fail; @@ -53,7 +53,7 @@ int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecContext *en if (ret < 0) goto fail; - for (y = 0; y<enc->height; y++) { + for (y = 0; y<par->height; y++) { memcpy(new_pkt->data + y*expected_stride, pkt->data + y*stride, FFMIN(expected_stride, stride)); memset(new_pkt->data + y*expected_stride + expected_stride - padding, 0, padding); } |