mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
output example: free the muxing format context properly
This commit is contained in:
parent
182d3f8221
commit
a5864e9a25
@ -549,18 +549,12 @@ int main(int argc, char **argv)
|
|||||||
if (have_audio)
|
if (have_audio)
|
||||||
close_stream(oc, &audio_st);
|
close_stream(oc, &audio_st);
|
||||||
|
|
||||||
/* Free the streams. */
|
|
||||||
for (i = 0; i < oc->nb_streams; i++) {
|
|
||||||
av_freep(&oc->streams[i]->codec);
|
|
||||||
av_freep(&oc->streams[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(fmt->flags & AVFMT_NOFILE))
|
if (!(fmt->flags & AVFMT_NOFILE))
|
||||||
/* Close the output file. */
|
/* Close the output file. */
|
||||||
avio_close(oc->pb);
|
avio_close(oc->pb);
|
||||||
|
|
||||||
/* free the stream */
|
/* free the stream */
|
||||||
av_free(oc);
|
avformat_free_context(oc);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user