]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvbsubdec.c
avfilter/buffersrc: postpone removal of sws_param
[ffmpeg] / libavcodec / dvbsubdec.c
index 1b75a2a46ba7f8e50b75c1aae3a7a87da521e036..f33744df0fa1c177c103e8967ac650d7278c22a9 100644 (file)
@@ -823,7 +823,7 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou
 
             memcpy(rect->data[0], region->pbuf, region->buf_size);
 
-            if ((clut == &default_clut && ctx->compute_clut == -1) || ctx->compute_clut == 1) {
+            if ((clut == &default_clut && ctx->compute_clut < 0) || ctx->compute_clut == 1) {
                 if (!region->has_computed_clut) {
                     compute_default_clut(ctx, region->computed_clut, rect, rect->w, rect->h);
                     region->has_computed_clut = 1;
@@ -832,18 +832,6 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou
                 memcpy(rect->data[1], region->computed_clut, sizeof(region->computed_clut));
             }
 
-#if FF_API_AVPICTURE
-FF_DISABLE_DEPRECATION_WARNINGS
-{
-            int j;
-            for (j = 0; j < 4; j++) {
-                rect->pict.data[j] = rect->data[j];
-                rect->pict.linesize[j] = rect->linesize[j];
-            }
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
             i++;
         }
     }
@@ -979,7 +967,8 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
         }
     }
 
-    region->has_computed_clut = 0;
+    if (ctx->compute_clut != -2)
+        region->has_computed_clut = 0;
 }
 
 static int dvbsub_parse_object_segment(AVCodecContext *avctx,
@@ -1034,10 +1023,13 @@ static int dvbsub_parse_object_segment(AVCodecContext *avctx,
         }
     } else if (coding_method == 1) {
         avpriv_report_missing_feature(avctx, "coded as a string of characters");
+        return AVERROR_PATCHWELCOME;
     } else if (coding_method == 2) {
         avpriv_report_missing_feature(avctx, "progressive coding of pixels");
+        return AVERROR_PATCHWELCOME;
     } else {
         av_log(avctx, AV_LOG_ERROR, "Unknown object coding %d\n", coding_method);
+        return AVERROR_INVALIDDATA;
     }
 
     return 0;
@@ -1734,7 +1726,7 @@ end:
 #define OFFSET(x) offsetof(DVBSubContext, x)
 static const AVOption options[] = {
     {"compute_edt", "compute end of time using pts or timeout", OFFSET(compute_edt), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DS},
-    {"compute_clut", "compute clut when not available(-1) or always(1) or never(0)", OFFSET(compute_clut), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, DS},
+    {"compute_clut", "compute clut when not available(-1) or only once (-2) or always(1) or never(0)", OFFSET(compute_clut), AV_OPT_TYPE_BOOL, {.i64 = -1}, -2, 1, DS},
     {"dvb_substream", "", OFFSET(substream), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 63, DS},
     {NULL}
 };
@@ -1745,7 +1737,7 @@ static const AVClass dvbsubdec_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-AVCodec ff_dvbsub_decoder = {
+const AVCodec ff_dvbsub_decoder = {
     .name           = "dvbsub",
     .long_name      = NULL_IF_CONFIG_SMALL("DVB subtitles"),
     .type           = AVMEDIA_TYPE_SUBTITLE,