changeset 869:8ff4e8ef8124 libavformat

allow NULL write_header() and write_trailer()
author michael
date Fri, 04 Nov 2005 23:50:11 +0000
parents c6b1dde68f3a
children 16df90bf46fd
files utils.c
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Sat Oct 29 00:52:02 2005 +0000
+++ b/utils.c	Fri Nov 04 23:50:11 2005 +0000
@@ -2253,9 +2253,11 @@
         }
     }
 
-    ret = s->oformat->write_header(s);
-    if (ret < 0)
-        return ret;
+    if(s->oformat->write_header){
+        ret = s->oformat->write_header(s);
+        if (ret < 0)
+            return ret;
+    }
 
     /* init PTS generation */
     for(i=0;i<s->nb_streams;i++) {
@@ -2540,7 +2542,8 @@
             goto fail;
     }
 
-    ret = s->oformat->write_trailer(s);
+    if(s->oformat->write_trailer)
+        ret = s->oformat->write_trailer(s);
 fail:
     if(ret == 0)
        ret=url_ferror(&s->pb);