You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avdevice/caca: switch to codecpar
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -92,7 +92,7 @@ static int caca_write_header(AVFormatContext *s)
|
|||||||
{
|
{
|
||||||
CACAContext *c = s->priv_data;
|
CACAContext *c = s->priv_data;
|
||||||
AVStream *st = s->streams[0];
|
AVStream *st = s->streams[0];
|
||||||
AVCodecContext *encctx = st->codec;
|
AVCodecParameters *encctx = st->codecpar;
|
||||||
int ret, bpp;
|
int ret, bpp;
|
||||||
|
|
||||||
c->ctx = s;
|
c->ctx = s;
|
||||||
@@ -126,10 +126,10 @@ static int caca_write_header(AVFormatContext *s)
|
|||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encctx->pix_fmt != AV_PIX_FMT_RGB24) {
|
if (encctx->format != AV_PIX_FMT_RGB24) {
|
||||||
av_log(s, AV_LOG_ERROR,
|
av_log(s, AV_LOG_ERROR,
|
||||||
"Unsupported pixel format '%s', choose rgb24\n",
|
"Unsupported pixel format '%s', choose rgb24\n",
|
||||||
av_get_pix_fmt_name(encctx->pix_fmt));
|
av_get_pix_fmt_name(encctx->format));
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ static int caca_write_header(AVFormatContext *s)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
bpp = av_get_bits_per_pixel(av_pix_fmt_desc_get(encctx->pix_fmt));
|
bpp = av_get_bits_per_pixel(av_pix_fmt_desc_get(encctx->format));
|
||||||
c->dither = caca_create_dither(bpp, encctx->width, encctx->height,
|
c->dither = caca_create_dither(bpp, encctx->width, encctx->height,
|
||||||
bpp / 8 * encctx->width,
|
bpp / 8 * encctx->width,
|
||||||
0x0000ff, 0x00ff00, 0xff0000, 0);
|
0x0000ff, 0x00ff00, 0xff0000, 0);
|
||||||
|
Reference in New Issue
Block a user