Commit 6e8e0e80 authored by michael's avatar michael

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3548 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent aec5446e
...@@ -278,8 +278,6 @@ static int ffm_write_trailer(AVFormatContext *s) ...@@ -278,8 +278,6 @@ static int ffm_write_trailer(AVFormatContext *s)
put_flush_packet(pb); put_flush_packet(pb);
} }
for(i=0;i<s->nb_streams;i++)
av_freep(&s->streams[i]->priv_data);
return 0; return 0;
} }
#endif //CONFIG_ENCODERS #endif //CONFIG_ENCODERS
......
...@@ -1012,9 +1012,6 @@ static int mpeg_mux_end(AVFormatContext *ctx) ...@@ -1012,9 +1012,6 @@ static int mpeg_mux_end(AVFormatContext *ctx)
//put_be32(&ctx->pb, ISO_11172_END_CODE); //put_be32(&ctx->pb, ISO_11172_END_CODE);
//put_flush_packet(&ctx->pb); //put_flush_packet(&ctx->pb);
for(i=0;i<ctx->nb_streams;i++)
av_freep(&ctx->streams[i]->priv_data);
return 0; return 0;
} }
#endif //CONFIG_ENCODERS #endif //CONFIG_ENCODERS
......
...@@ -2094,13 +2094,13 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){ ...@@ -2094,13 +2094,13 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
* @return 0 if OK. AVERROR_xxx if error. */ * @return 0 if OK. AVERROR_xxx if error. */
int av_write_trailer(AVFormatContext *s) int av_write_trailer(AVFormatContext *s)
{ {
int ret; int ret, i;
for(;;){ for(;;){
AVPacket pkt; AVPacket pkt;
ret= av_interleave_packet(s, &pkt, NULL, 1); ret= av_interleave_packet(s, &pkt, NULL, 1);
if(ret<0) //FIXME cleanup needed for ret<0 ? if(ret<0) //FIXME cleanup needed for ret<0 ?
return ret; goto fail;
if(!ret) if(!ret)
break; break;
...@@ -2110,10 +2110,13 @@ int av_write_trailer(AVFormatContext *s) ...@@ -2110,10 +2110,13 @@ int av_write_trailer(AVFormatContext *s)
av_free_packet(&pkt); av_free_packet(&pkt);
if(ret<0) if(ret<0)
return ret; goto fail;
} }
ret = s->oformat->write_trailer(s); 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); av_freep(&s->priv_data);
return ret; return ret;
} }
......
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