changeset 6073:b9ddee1ca18c libavformat

Make write_header() and write_header() return an error code in case of error.
author stefano
date Wed, 02 Jun 2010 21:57:35 +0000
parents 0475ccdb762d
children 258c2ccc68b5
files nutenc.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/nutenc.c	Wed Jun 02 21:57:30 2010 +0000
+++ b/nutenc.c	Wed Jun 02 21:57:35 2010 +0000
@@ -520,7 +520,8 @@
         ret = url_open_dyn_buf(&dyn_bc);
         if(ret < 0)
             return ret;
-        write_streamheader(avctx, dyn_bc, nut->avf->streams[i], i);
+        if ((ret = write_streamheader(avctx, dyn_bc, nut->avf->streams[i], i)) < 0)
+            return ret;
         put_packet(nut, bc, dyn_bc, 1, STREAM_STARTCODE);
     }
 
@@ -554,7 +555,7 @@
 static int write_header(AVFormatContext *s){
     NUTContext *nut = s->priv_data;
     ByteIOContext *bc = s->pb;
-    int i, j;
+    int i, j, ret;
 
     nut->avf= s;
 
@@ -594,7 +595,8 @@
     put_buffer(bc, ID_STRING, strlen(ID_STRING));
     put_byte(bc, 0);
 
-    write_headers(s, bc);
+    if ((ret = write_headers(s, bc)) < 0)
+        return ret;
 
     put_flush_packet(bc);