On 10/17/11 3:31 AM, [email protected] wrote:
+static uint8_t *get_line(AVIOContext *s)
+{
+    AVIOContext *line;
+    uint8_t *buf;
+    char c;
+
+    if (avio_open_dyn_buf(&line)<  0) {
+        av_log(NULL, AV_LOG_FATAL, "Could not alloc buffer for reading 
preset.\n");
+        exit_program(1);
+    }
+
+    while (c = avio_r8(s)&&  c != '\n')
+        avio_w8(line, c);
+    avio_w8(line, 0);
+    avio_close_dyn_buf(line,&buf);
+
+    return buf;
+}

Compare to the get_line from ffmetadec.c and the other similar code in libav. We might as well unify that and put it in libavutil.

It can be done later though.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to