diff options
Diffstat (limited to 'libavformat/subtitles.h')
-rw-r--r-- | libavformat/subtitles.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/subtitles.h b/libavformat/subtitles.h index 455b374f25..96de9fa5d4 100644 --- a/libavformat/subtitles.h +++ b/libavformat/subtitles.h @@ -96,4 +96,14 @@ const char *ff_smil_get_attr_ptr(const char *s, const char *attr); */ void ff_subtitles_read_chunk(AVIOContext *pb, AVBPrint *buf); +/** + * Get the number of characters to increment to jump to the next line, or to + * the end of the string. + */ +static av_always_inline int ff_subtitles_next_line(const char *ptr) +{ + int n = strcspn(ptr, "\n"); + return n + !!*ptr; +} + #endif /* AVFORMAT_SUBTITLES_H */ |