# HG changeset patch # User aurel # Date 1279748341 0 # Node ID e62d23b0547d15bc9753597e1e08e2b017e8b890 # Parent 660647077ab9516c97373ad3966d4e46f808f9b4 move ff_get_line to aviobuf.c diff -r 660647077ab9 -r e62d23b0547d assdec.c --- a/assdec.c Wed Jul 21 21:35:44 2010 +0000 +++ b/assdec.c Wed Jul 21 21:39:01 2010 +0000 @@ -20,6 +20,7 @@ */ #include "avformat.h" +#include "internal.h" #define MAX_LINESIZE 2000 @@ -30,20 +31,6 @@ unsigned int event_index; }ASSContext; -static void ff_get_line(ByteIOContext *s, char *buf, int maxlen) -{ - int i = 0; - char c; - - do{ - c = get_byte(s); - if (i < maxlen-1) - buf[i++] = c; - }while(c != '\n' && c); - - buf[i] = 0; -} - static int probe(AVProbeData *p) { const char *header= "[Script Info]"; diff -r 660647077ab9 -r e62d23b0547d aviobuf.c --- a/aviobuf.c Wed Jul 21 21:35:44 2010 +0000 +++ b/aviobuf.c Wed Jul 21 21:39:01 2010 +0000 @@ -554,6 +554,20 @@ return buf; } +void ff_get_line(ByteIOContext *s, char *buf, int maxlen) +{ + int i = 0; + char c; + + do { + c = get_byte(s); + if (i < maxlen-1) + buf[i++] = c; + } while (c != '\n' && c); + + buf[i] = 0; +} + uint64_t get_be64(ByteIOContext *s) { uint64_t val; diff -r 660647077ab9 -r e62d23b0547d internal.h --- a/internal.h Wed Jul 21 21:35:44 2010 +0000 +++ b/internal.h Wed Jul 21 21:39:01 2010 +0000 @@ -167,6 +167,8 @@ */ void ff_put_v(ByteIOContext *bc, uint64_t val); +void ff_get_line(ByteIOContext *s, char *buf, int maxlen); + #define SPACE_CHARS " \t\r\n" #endif /* AVFORMAT_INTERNAL_H */