History

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.)

Andreas Rheinhardt committed 2 years ago

Commit 518f79f1 parent 1a545261 file · +2 −4Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/mpeg12dec.c+2−4
@@ -1303,7 +1303,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 1302 unmodified lines
13031303 s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST *
13041304 (s->picture_structure == PICT_TOP_FIELD);
13051305
1306− for (int i = 0; i < 4; i++) {
1306+ for (int i = 0; i < 3; i++) {
13071307 if (s->picture_structure == PICT_BOTTOM_FIELD) {
13081308 s->current_picture.f->data[i] = FF_PTR_ADD(s->current_picture.f->data[i],
13091309 s->current_picture.f->linesize[i]);
@@ -1368,8 +1368,6 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 58 unmodified lines
13681368 if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME))
13691369 ff_thread_finish_setup(avctx);
13701370 } else { // second field
1371− int i;
1372−
13731371 if (!s->current_picture_ptr) {
13741372 av_log(s->avctx, AV_LOG_ERROR, "first field missing\n");
13751373 return AVERROR_INVALIDDATA;
@@ -1383,7 +1381,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 7 unmodified lines
13831381 }
13841382 }
13851383
1386− for (i = 0; i < 4; i++) {
1384+ for (int i = 0; i < 3; i++) {
13871385 s->current_picture.f->data[i] = s->current_picture_ptr->f->data[i];
13881386 if (s->picture_structure == PICT_BOTTOM_FIELD)
13891387 s->current_picture.f->data[i] +=

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t