diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-04-05 06:06:17 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-04-08 15:00:02 +0200 |
commit | 518f79f2a83d07f8917e5acda794f0481a93e2d4 (patch) | |
tree | 20012b9b529d5c5967ed6b78e7728f16b345c890 | |
parent | 1a5452655aeebe832e84561769e81e2c3062a8a9 (diff) |
avcodec/mpeg12dec: Don't pretend MPEG-1/2 to support alpha
(FF_PTR_ADD has to be kept although MPEG-1/2 only supports
YUV pixel formats because our decoder also supports decoding
to AV_PIX_FMT_GRAY8 depending upon CONFIG_GRAY.)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavcodec/mpeg12dec.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 83ff40d237..337654c88d 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1303,7 +1303,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * (s->picture_structure == PICT_TOP_FIELD); - for (int i = 0; i < 4; i++) { + for (int i = 0; i < 3; i++) { if (s->picture_structure == PICT_BOTTOM_FIELD) { s->current_picture.f->data[i] = FF_PTR_ADD(s->current_picture.f->data[i], s->current_picture.f->linesize[i]); @@ -1368,8 +1368,6 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME)) ff_thread_finish_setup(avctx); } else { // second field - int i; - if (!s->current_picture_ptr) { av_log(s->avctx, AV_LOG_ERROR, "first field missing\n"); return AVERROR_INVALIDDATA; @@ -1383,7 +1381,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) } } - for (i = 0; i < 4; i++) { + for (int i = 0; i < 3; i++) { s->current_picture.f->data[i] = s->current_picture_ptr->f->data[i]; if (s->picture_structure == PICT_BOTTOM_FIELD) s->current_picture.f->data[i] += |