[FFmpeg-devel] [PATCH] avcodec/dvbsubdec: Add option to select when to computer clut (always/never/"if needed")

Michael Niedermayer michael at niedermayer.cc
Mon Jul 27 00:07:59 CEST 2015


On Mon, Jul 27, 2015 at 01:38:53AM +0530, Anshul wrote:
> On July 26, 2015 10:33:22 PM IST, Michael Niedermayer <michaelni at gmx.at> wrote:
> >From: Michael Niedermayer <michael at niedermayer.cc>
> >
> >Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> >---
> > libavcodec/dvbsubdec.c |    4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> >diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
> >index 9f59b72..e3b72ab 100644
> >--- a/libavcodec/dvbsubdec.c
> >+++ b/libavcodec/dvbsubdec.c
> >@@ -237,6 +237,7 @@ typedef struct DVBSubContext {
> >     int time_out;
> >     int compute_edt; /**< if 1 end display time calculated using pts
> >                           if 0 (Default) calculated using time out */
> >+    int compute_clut;
> >     int64_t prev_start;
> >     DVBSubRegion *region_list;
> >     DVBSubCLUT   *clut_list;
> >@@ -912,7 +913,7 @@ static int save_subtitle_set(AVCodecContext *avctx,
> >AVSubtitle *sub, int *got_ou
> > 
> >            memcpy(rect->pict.data[0], region->pbuf, region->buf_size);
> > 
> >-            if (clut == &default_clut)
> >+            if ((clut == &default_clut && ctx->compute_clut == -1) ||
> >ctx->compute_clut == 1)
> >                 compute_default_clut(&rect->pict, rect->w, rect->h);
> > 
> >             i++;
> >@@ -1706,6 +1707,7 @@ end:
> > #define DS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_SUBTITLE_PARAM
> > static const AVOption options[] = {
> >{"compute_edt", "compute end of time using pts or timeout",
> >offsetof(DVBSubContext, compute_edt), FF_OPT_TYPE_INT, {.i64 = 0}, 0,
> >1, DS},
> >+    {"compute_clut", "compute clut when not available(-1) or always(1)
> >or never(0)", offsetof(DVBSubContext, compute_clut), FF_OPT_TYPE_INT,
> >{.i64 = -1}, -1, 1, DS},
> >     {NULL}
> > };
> > static const AVClass dvbsubdec_class = {
> >-- 
> >1.7.9.5
> >
> >_______________________________________________
> >ffmpeg-devel mailing list
> >ffmpeg-devel at ffmpeg.org
> >http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> 
> LGTM.

applied

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150727/e00b2d76/attachment.sig>


More information about the ffmpeg-devel mailing list