ffserver: reflow close_connection()

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2014-12-26 18:43:40 -03:00
parent 1146223699
commit 0121ddabb8
1 changed files with 5 additions and 7 deletions

View File

@ -836,15 +836,13 @@ static void close_connection(HTTPContext *c)
ctx = &c->fmt_ctx;
if (!c->last_packet_sent && c->state == HTTPSTATE_SEND_DATA_TRAILER) {
if (ctx->oformat) {
/* prepare header */
if (avio_open_dyn_buf(&ctx->pb) >= 0) {
if (ctx->oformat && avio_open_dyn_buf(&ctx->pb) >= 0) {
av_write_trailer(ctx);
av_freep(&c->pb_buffer);
avio_close_dyn_buf(ctx->pb, &c->pb_buffer);
}
}
}
for(i=0; i<ctx->nb_streams; i++)
av_freep(&ctx->streams[i]);