changeset 6300:e62d23b0547d libavformat

move ff_get_line to aviobuf.c
author aurel
date Wed, 21 Jul 2010 21:39:01 +0000
parents 660647077ab9
children 1b2b5dbcf549
files assdec.c aviobuf.c internal.h
diffstat 3 files changed, 17 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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]";
--- 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;
--- 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 */