[Ffmpeg-cvslog] r8110 - trunk/ffserver.c

alex subversion
Sat Feb 24 03:24:42 CET 2007


Author: alex
Date: Sat Feb 24 03:24:42 2007
New Revision: 8110

Modified:
   trunk/ffserver.c

Log:
return error if av_write_header failed (it fails on some containers when codec is not supported)

Modified: trunk/ffserver.c
==============================================================================
--- trunk/ffserver.c	(original)
+++ trunk/ffserver.c	Sat Feb 24 03:24:42 2007
@@ -2033,7 +2033,8 @@
         c->fmt_ctx.pb.is_streamed = 1;
 
         av_set_parameters(&c->fmt_ctx, NULL);
-        av_write_header(&c->fmt_ctx);
+        if (av_write_header(&c->fmt_ctx) < 0)
+            return -1;
 
         len = url_close_dyn_buf(&c->fmt_ctx.pb, &c->pb_buffer);
         c->buffer_ptr = c->pb_buffer;
@@ -3525,7 +3526,10 @@
                 s->streams[i] = st;
             }
             av_set_parameters(s, NULL);
-            av_write_header(s);
+            if (av_write_header(s) < 0) {
+                fprintf(stderr, "Container doesn't supports the required parameters\n");
+                exit(1);
+            }
             /* XXX: need better api */
             av_freep(&s->priv_data);
             url_fclose(&s->pb);




More information about the ffmpeg-cvslog mailing list