1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/hdsenc: Simplify code by using avio_closep()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-01-08 14:13:36 +01:00
parent e5993aeb60
commit b565fd4464

View File

@ -140,8 +140,7 @@ static void hds_free(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) { for (i = 0; i < s->nb_streams; i++) {
OutputStream *os = &c->streams[i]; OutputStream *os = &c->streams[i];
if (os->out) if (os->out)
avio_close(os->out); avio_closep(&os->out);
os->out = NULL;
if (os->ctx && os->ctx_inited) if (os->ctx && os->ctx_inited)
av_write_trailer(os->ctx); av_write_trailer(os->ctx);
if (os->ctx && os->ctx->pb) if (os->ctx && os->ctx->pb)
@ -311,8 +310,7 @@ static void close_file(OutputStream *os)
avio_seek(os->out, 0, SEEK_SET); avio_seek(os->out, 0, SEEK_SET);
avio_wb32(os->out, pos); avio_wb32(os->out, pos);
avio_flush(os->out); avio_flush(os->out);
avio_close(os->out); avio_closep(&os->out);
os->out = NULL;
} }
static int hds_write_header(AVFormatContext *s) static int hds_write_header(AVFormatContext *s)