History

avcodec/mjpegenc: Include all supported pix_fmts in mpegenc pix_fmts

Currently said list contains only the pixel formats that are always supported irrespective of the range and the value of strict_std_compliance. This makes the MJPEG encoder an outlier as all other codecs put all potentially supported pixel formats into said list and error out if the chosen pixel format is unsupported. This commit brings it therefore in line with the other encoders. The behaviour of fftools/ffmpeg_filter.c has been preserved. A more informed decision would be possible if colour range were available at this point, but it isn't.

Andreas Rheinhardt committed 5 years ago

Commit 059fc2d1 parent 48cda7d7 files · +40 −55Browse files

Showing the changes to libavcodec/encode.c (1 of 7 files). Show all

Unified · Split

libavcodec/encode.c+1−3
@@ -564,9 +564,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 563 unmodified lines
564 for (i = 0; avctx->codec->pix_fmts[i] != AV_PIX_FMT_NONE; i++)564 for (i = 0; avctx->codec->pix_fmts[i] != AV_PIX_FMT_NONE; i++)
565 if (avctx->pix_fmt == avctx->codec->pix_fmts[i])565 if (avctx->pix_fmt == avctx->codec->pix_fmts[i])
566 break;566 break;
567 if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_NONE567 if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_NONE) {
568 && !(avctx->codec_id == AV_CODEC_ID_MJPEG
569 && avctx->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL)) {
570 char buf[128];568 char buf[128];
571 snprintf(buf, sizeof(buf), "%d", avctx->pix_fmt);569 snprintf(buf, sizeof(buf), "%d", avctx->pix_fmt);
572 av_log(avctx, AV_LOG_ERROR, "Specified pixel format %s is invalid or not supported\n",570 av_log(avctx, AV_LOG_ERROR, "Specified pixel format %s is invalid or not supported\n",

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