diff options
author | Clément Bœsch <ubitux@gmail.com> | 2012-12-28 01:15:01 +0100 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2012-12-30 22:58:58 +0100 |
commit | d9ac8d296725fef605989b4c9d297fb65c40e2e5 (patch) | |
tree | fd6a6663d37da958ffe7484964972ae72ce57672 /libavformat/subtitles.h | |
parent | 67286fa98b1ebbf005de784b47852f8d429d03c8 (diff) | |
download | ffmpeg-d9ac8d296725fef605989b4c9d297fb65c40e2e5.tar.gz |
lavf: move srtdec:read_chunk() to subtitles utils.
This function can be useful for various other subtitles formats.
Diffstat (limited to 'libavformat/subtitles.h')
-rw-r--r-- | libavformat/subtitles.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavformat/subtitles.h b/libavformat/subtitles.h index 55e6182922..eb76192fdf 100644 --- a/libavformat/subtitles.h +++ b/libavformat/subtitles.h @@ -81,4 +81,19 @@ int ff_smil_extract_next_chunk(AVIOContext *pb, AVBPrint *buf, char *c); */ const char *ff_smil_get_attr_ptr(const char *s, const char *attr); +/** + * @brief Read a subtitles chunk. + * + * A chunk is defined by a multiline "event", ending with a second line break. + * The trailing line breaks are trimmed. CLRF are supported. + * Example: "foo\r\nbar\r\n\r\nnext" will print "foo\r\nbar" into buf, and pb + * will focus on the 'n' of the "next" string. + * + * @param pb I/O context + * @param buf an initialized buf where the chunk is written + * + * @note buf is cleared before writing into it. + */ +void ff_subtitles_read_chunk(AVIOContext *pb, AVBPrint *buf); + #endif /* AVFORMAT_SUBTITLES_H */ |