Browse Source

examples/demuxing: free AVPacket after usage

Fix leak.
tags/n1.2
Angelo Haller Stefano Sabatini 12 years ago
parent
commit
e7a39e163d
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      doc/examples/demuxing.c

+ 3
- 1
doc/examples/demuxing.c View File

@@ -292,8 +292,10 @@ int main (int argc, char **argv)
printf("Demuxing audio from file '%s' into '%s'\n", src_filename, audio_dst_filename); printf("Demuxing audio from file '%s' into '%s'\n", src_filename, audio_dst_filename);


/* read frames from the file */ /* read frames from the file */
while (av_read_frame(fmt_ctx, &pkt) >= 0)
while (av_read_frame(fmt_ctx, &pkt) >= 0) {
decode_packet(&got_frame, 0); decode_packet(&got_frame, 0);
av_free_packet(&pkt);
}


/* flush cached frames */ /* flush cached frames */
pkt.data = NULL; pkt.data = NULL;


Loading…
Cancel
Save