summaryrefslogtreecommitdiffstats
path: root/libavcodec/textdec.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-12-28 05:15:00 +0100
committerClément Bœsch <ubitux@gmail.com>2012-12-30 23:55:28 +0100
commit7b43402724b21cca805c8afac6ec33a211d52b85 (patch)
treeab285806766de979f79df1f47bc716cd4cc98d94 /libavcodec/textdec.c
parent580ee973d16cb5afb3d5974133576d6c570d2dda (diff)
downloadffmpeg-streaming-7b43402724b21cca805c8afac6ec33a211d52b85.zip
ffmpeg-streaming-7b43402724b21cca805c8afac6ec33a211d52b85.tar.gz
Add PJS subtitles demuxer and decoder.
Diffstat (limited to 'libavcodec/textdec.c')
-rw-r--r--libavcodec/textdec.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/libavcodec/textdec.c b/libavcodec/textdec.c
index 9e19b37..32af644 100644
--- a/libavcodec/textdec.c
+++ b/libavcodec/textdec.c
@@ -128,17 +128,19 @@ AVCodec ff_text_decoder = {
};
#endif
-#if CONFIG_VPLAYER_DECODER
-#define vplayer_options options
-DECLARE_CLASS(vplayer);
+#if CONFIG_VPLAYER_DECODER || CONFIG_PJS_DECODER
-static int vplayer_init(AVCodecContext *avctx)
+static int linebreak_init(AVCodecContext *avctx)
{
TextContext *text = avctx->priv_data;
text->linebreaks = "|";
return ff_ass_subtitle_header_default(avctx);
}
+#if CONFIG_VPLAYER_DECODER
+#define vplayer_options options
+DECLARE_CLASS(vplayer);
+
AVCodec ff_vplayer_decoder = {
.name = "vplayer",
.priv_data_size = sizeof(TextContext),
@@ -146,7 +148,25 @@ AVCodec ff_vplayer_decoder = {
.type = AVMEDIA_TYPE_SUBTITLE,
.id = AV_CODEC_ID_VPLAYER,
.decode = text_decode_frame,
- .init = vplayer_init,
+ .init = linebreak_init,
.priv_class = &vplayer_decoder_class,
};
#endif
+
+#if CONFIG_PJS_DECODER
+#define pjs_options options
+DECLARE_CLASS(pjs);
+
+AVCodec ff_pjs_decoder = {
+ .name = "pjs",
+ .priv_data_size = sizeof(TextContext),
+ .long_name = NULL_IF_CONFIG_SMALL("PJS subtitle"),
+ .type = AVMEDIA_TYPE_SUBTITLE,
+ .id = AV_CODEC_ID_PJS,
+ .decode = text_decode_frame,
+ .init = linebreak_init,
+ .priv_class = &pjs_decoder_class,
+};
+#endif
+
+#endif /* text subtitles with '|' line break */
OpenPOWER on IntegriCloud