diff options
author | wm4 <nfxjfg@googlemail.com> | 2014-09-02 20:53:08 +0200 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2014-09-05 23:13:07 +0200 |
commit | 231a514dd3d246b38d0bf2a400a1759902a6f051 (patch) | |
tree | 9adf769211047d5a7b84d7a312673e3f9a20ee11 /libavformat/subtitles.c | |
parent | d658ef18e3d1ebe63a64f404ac4646890ecf02c9 (diff) | |
download | ffmpeg-231a514dd3d246b38d0bf2a400a1759902a6f051.tar.gz |
avformat/samidec: UTF-16 support
ff_smil_extract_next_chunk() is still used by RealText.
Diffstat (limited to 'libavformat/subtitles.c')
-rw-r--r-- | libavformat/subtitles.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c index bb526cd5e6..6b59538753 100644 --- a/libavformat/subtitles.c +++ b/libavformat/subtitles.c @@ -274,20 +274,20 @@ void ff_subtitles_queue_clean(FFDemuxSubtitlesQueue *q) q->nb_subs = q->allocated_size = q->current_sub_idx = 0; } -int ff_smil_extract_next_chunk(AVIOContext *pb, AVBPrint *buf, char *c) +int ff_smil_extract_next_text_chunk(FFTextReader *tr, AVBPrint *buf, char *c) { int i = 0; char end_chr; if (!*c) // cached char? - *c = avio_r8(pb); + *c = ff_text_r8(tr); if (!*c) return 0; end_chr = *c == '<' ? '>' : '<'; do { av_bprint_chars(buf, *c, 1); - *c = avio_r8(pb); + *c = ff_text_r8(tr); i++; } while (*c != end_chr && *c); if (end_chr == '>') { @@ -297,6 +297,15 @@ int ff_smil_extract_next_chunk(AVIOContext *pb, AVBPrint *buf, char *c) return i; } +int ff_smil_extract_next_chunk(AVIOContext *pb, AVBPrint *buf, char *c) +{ + FFTextReader tr; + tr.buf_pos = tr.buf_len = 0; + tr.type = 0; + tr.pb = pb; + return ff_smil_extract_next_text_chunk(&tr, buf, c); +} + const char *ff_smil_get_attr_ptr(const char *s, const char *attr) { int in_quotes = 0; |