summaryrefslogtreecommitdiff
path: root/doc/examples/filtering_audio.c
diff options
context:
space:
mode:
authorGavin Kinsey <gkinsey@ad-holdings.co.uk>2012-06-26 19:00:30 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-06-26 19:04:17 +0200
commit37b5959d9689f5310640c7a0beaa7784c58bfa6f (patch)
treea9ab5d52be1adb924963ca8d76648610f4d323c7 /doc/examples/filtering_audio.c
parent9ebed95db6c4fece96f56c10f50acf5ec47dc308 (diff)
examples/filtering: fix packet memleak
Free packets unconditionally after demuxing, and not only when the packets belong to a given stream. Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
Diffstat (limited to 'doc/examples/filtering_audio.c')
-rw-r--r--doc/examples/filtering_audio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/examples/filtering_audio.c b/doc/examples/filtering_audio.c
index cca28e9e2b..4d96438b09 100644
--- a/doc/examples/filtering_audio.c
+++ b/doc/examples/filtering_audio.c
@@ -195,7 +195,6 @@ int main(int argc, char **argv)
avcodec_get_frame_defaults(&frame);
got_frame = 0;
ret = avcodec_decode_audio4(dec_ctx, &frame, &got_frame, &packet);
- av_free_packet(&packet);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error decoding audio\n");
continue;
@@ -222,6 +221,7 @@ int main(int argc, char **argv)
}
}
}
+ av_free_packet(&packet);
}
end:
avfilter_graph_free(&filter_graph);