提交 c40a3a42 编写于 作者: M Michael Niedermayer

move free() of AVStream priv data to av_write_trailer()

Originally committed as revision 3548 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 95f97de1
......@@ -278,8 +278,6 @@ static int ffm_write_trailer(AVFormatContext *s)
put_flush_packet(pb);
}
for(i=0;i<s->nb_streams;i++)
av_freep(&s->streams[i]->priv_data);
return 0;
}
#endif //CONFIG_ENCODERS
......
......@@ -1012,9 +1012,6 @@ static int mpeg_mux_end(AVFormatContext *ctx)
//put_be32(&ctx->pb, ISO_11172_END_CODE);
//put_flush_packet(&ctx->pb);
for(i=0;i<ctx->nb_streams;i++)
av_freep(&ctx->streams[i]->priv_data);
return 0;
}
#endif //CONFIG_ENCODERS
......
......@@ -2094,13 +2094,13 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
* @return 0 if OK. AVERROR_xxx if error. */
int av_write_trailer(AVFormatContext *s)
{
int ret;
int ret, i;
for(;;){
AVPacket pkt;
ret= av_interleave_packet(s, &pkt, NULL, 1);
if(ret<0) //FIXME cleanup needed for ret<0 ?
return ret;
goto fail;
if(!ret)
break;
......@@ -2110,10 +2110,13 @@ int av_write_trailer(AVFormatContext *s)
av_free_packet(&pkt);
if(ret<0)
return ret;
goto fail;
}
ret = s->oformat->write_trailer(s);
fail:
for(i=0;i<s->nb_streams;i++)
av_freep(&s->streams[i]->priv_data);
av_freep(&s->priv_data);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册