On Fri, May 01, 2015 at 01:48:34AM +0200, Carl Eugen Hoyos wrote: > Hi! > > Attached patch improves the samples from ticket #2933. > > Please comment, Carl Eugen
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index 2552962..9bd69c5 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -500,6 +500,7 @@ void avcodec_register_all(void)
> REGISTER_DECODER(MICRODVD, microdvd);
> REGISTER_ENCDEC (MOVTEXT, movtext);
> REGISTER_DECODER(MPL2, mpl2);
> + REGISTER_DECODER(ONCAPTION, oncaption);
> REGISTER_DECODER(PGSSUB, pgssub);
> REGISTER_DECODER(PJS, pjs);
> REGISTER_DECODER(REALTEXT, realtext);
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 8c7c420..be91dcb 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -525,6 +525,7 @@ enum AVCodecID {
> AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'),
> AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'),
> AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined
> in Matroska
> + AV_CODEC_ID_ONCAPTION = MKBETAG('o','n','C','a'),
>
> /* other specific kind of codecs (generally used for attachments) */
> AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing
> at the start of various fake codecs.
> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> index c1694f3..c286a01 100644
> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -2705,6 +2705,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
> .long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
> .props = AV_CODEC_PROP_TEXT_SUB,
> },
> + {
> + .id = AV_CODEC_ID_ONCAPTION,
> + .type = AVMEDIA_TYPE_SUBTITLE,
> + .name = "oncaption",
> + .long_name = NULL_IF_CONFIG_SMALL("OnCaption FLV subtitle"),
> + .props = AV_CODEC_PROP_TEXT_SUB,
> + },
>
> /* other kind of codecs and pseudo-codecs */
> {
> diff --git a/libavcodec/textdec.c b/libavcodec/textdec.c
> index c9f02a2..6b46938 100644
> --- a/libavcodec/textdec.c
> +++ b/libavcodec/textdec.c
> @@ -88,6 +88,29 @@ AVCodec ff_text_decoder = {
> };
> #endif
>
> +#if CONFIG_ONCAPTION_DECODER
> +#define oncaption_options options
> +DECLARE_CLASS(oncaption);
> +
> +static int oncaption_linebreak_init(AVCodecContext *avctx)
> +{
> + TextContext *text = avctx->priv_data;
> + text->linebreaks = "<br/>";
i'm afraid this won't be enough to support "<br>", "<BR>", "<br />", ...
[...]
--
Clément B.
pgpvKXvERGYGs.pgp
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
