Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit e96a2343c9a7db0cefb58608339fd852a82a0e99
- Author: Eejya Singh <singh.eejya@gmail.com>
- Date: Wed Feb 11 22:46:36 2015 +0530
- ASS markup stripper
- diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
- index 99467bb..3c0e487 100644
- --- a/libavcodec/avcodec.h
- +++ b/libavcodec/avcodec.h
- @@ -766,7 +766,7 @@ typedef struct RcOverride{
- #define CODEC_FLAG2_SHOW_ALL 0x00400000 ///< Show all frames before the first keyframe
- #define CODEC_FLAG2_EXPORT_MVS 0x10000000 ///< Export motion vectors through frame side data
- #define CODEC_FLAG2_SKIP_MANUAL 0x20000000 ///< Do not skip samples and export skip information as frame side data
- -
- +#define CODEC_FLAG2_RAWTEXTSUB 0x40000000 ///<Strip markup from ASS subtitles
- /* Unsupported options :
- * Syntax Arithmetic coding (SAC)
- * Reference Picture Selection
- diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
- index 1d5b078..d448fef 100644
- --- a/libavcodec/options_table.h
- +++ b/libavcodec/options_table.h
- @@ -90,6 +90,7 @@ static const AVOption avcodec_options[] = {
- {"showall", "Show all frames before the first keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SHOW_ALL }, INT_MIN, INT_MAX, V|D, "flags2"},
- {"export_mvs", "export motion vectors through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_EXPORT_MVS}, INT_MIN, INT_MAX, V|D, "flags2"},
- {"skip_manual", "do not skip samples and export skip information as frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SKIP_MANUAL}, INT_MIN, INT_MAX, V|D, "flags2"},
- +{"rawtextsub", "Strip ASS markup from subs", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_RAWTEXTSUB }, INT_MIN, INT_MAX, V|S, "flags2"},
- {"me_method", "set motion estimation method", OFFSET(me_method), AV_OPT_TYPE_INT, {.i64 = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method"},
- {"zero", "zero motion estimation (fastest)", 0, AV_OPT_TYPE_CONST, {.i64 = ME_ZERO }, INT_MIN, INT_MAX, V|E, "me_method" },
- {"full", "full motion estimation (slowest)", 0, AV_OPT_TYPE_CONST, {.i64 = ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" },
- diff --git a/libavcodec/utils.c b/libavcodec/utils.c
- index 1ec5cae..a56037f 100644
- --- a/libavcodec/utils.c
- +++ b/libavcodec/utils.c
- @@ -2701,7 +2701,11 @@ static int utf8_check(const uint8_t *str)
- }
- return 1;
- }
- -
- +static int dummy_function(AVCodecContext *avctx)
- +{
- + av_log(avctx, 0,"Hello World!");
- + return 0;
- +}
- int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
- int *got_sub_ptr,
- AVPacket *avpkt)
- @@ -2758,7 +2762,11 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
- sub->end_display_time = av_rescale_q(avpkt->duration,
- avctx->pkt_timebase, ms);
- }
- -
- + if(avctx->flags2 & CODEC_FLAG2_RAWTEXTSUB)
- + {
- + dummy_function(avctx);
- + av_log(avctx,0,"Dummy Function being called!\n");
- + }
- for (i = 0; i < sub->num_rects; i++) {
- if (sub->rects[i]->ass && !utf8_check(sub->rects[i]->ass)) {
- av_log(avctx, AV_LOG_ERROR,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement