Commit f75cdda7 authored by Alex Beregszaszi's avatar Alex Beregszaszi
Browse files

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

Originally committed as revision 8110 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 638831aa
...@@ -2033,7 +2033,8 @@ static int http_prepare_data(HTTPContext *c) ...@@ -2033,7 +2033,8 @@ static int http_prepare_data(HTTPContext *c)
c->fmt_ctx.pb.is_streamed = 1; c->fmt_ctx.pb.is_streamed = 1;
av_set_parameters(&c->fmt_ctx, NULL); 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); len = url_close_dyn_buf(&c->fmt_ctx.pb, &c->pb_buffer);
c->buffer_ptr = c->pb_buffer; c->buffer_ptr = c->pb_buffer;
...@@ -3525,7 +3526,10 @@ static void build_feed_streams(void) ...@@ -3525,7 +3526,10 @@ static void build_feed_streams(void)
s->streams[i] = st; s->streams[i] = st;
} }
av_set_parameters(s, NULL); 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 */ /* XXX: need better api */
av_freep(&s->priv_data); av_freep(&s->priv_data);
url_fclose(&s->pb); url_fclose(&s->pb);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment