return error if av_write_header failed (it fails on some containers when codec is...
authorAlex Beregszaszi <alex@rtfs.hu>
Sat, 24 Feb 2007 02:24:42 +0000 (02:24 +0000)
committerAlex Beregszaszi <alex@rtfs.hu>
Sat, 24 Feb 2007 02:24:42 +0000 (02:24 +0000)
Originally committed as revision 8110 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffserver.c

index 7b64cc7..696c9a9 100644 (file)
@@ -2033,7 +2033,8 @@ static int http_prepare_data(HTTPContext *c)
         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 @@ static void build_feed_streams(void)
                 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);