diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2007-02-24 02:24:42 +0000 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2007-02-24 02:24:42 +0000 |
commit | f75cdda7185b5bb12da438a51cb9b7c5c59e51a1 (patch) | |
tree | f0215934b1651062e0fd341a534715dffa86b37e | |
parent | 638831aacc683da40bb0e126e937047242463b72 (diff) | |
download | ffmpeg-f75cdda7185b5bb12da438a51cb9b7c5c59e51a1.tar.gz |
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
-rw-r--r-- | ffserver.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ffserver.c b/ffserver.c index 7b64cc7a58..696c9a94ad 100644 --- a/ffserver.c +++ b/ffserver.c @@ -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); |