[FFmpeg-cvslog] avformat/seek: move the cur variable into the loop
Michael Niedermayer
git at videolan.org
Wed Dec 24 13:20:13 CET 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Dec 24 13:01:31 2014 +0100| [96dce6f7ceaa8d3c7eddd241213bec82e84e7f7a] | committer: Michael Niedermayer
avformat/seek: move the cur variable into the loop
This improves readability and makes it clear that the freed
value is not used after the end of an iteration
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=96dce6f7ceaa8d3c7eddd241213bec82e84e7f7a
---
libavformat/seek.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavformat/seek.c b/libavformat/seek.c
index 6a38ba7..967f282 100644
--- a/libavformat/seek.c
+++ b/libavformat/seek.c
@@ -476,9 +476,8 @@ void ff_restore_parser_state(AVFormatContext *s, AVParserState *state)
static void free_packet_list(AVPacketList *pktl)
{
- AVPacketList *cur;
while (pktl) {
- cur = pktl;
+ AVPacketList *cur = pktl;
pktl = cur->next;
av_free_packet(&cur->pkt);
av_free(cur);
More information about the ffmpeg-cvslog
mailing list