aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-09-21 09:10:23 +0200
committerAnton Khirnov <anton@khirnov.net>2012-09-24 12:31:25 +0200
commit11d1ca4b2c406bee2d22b04268a43b0873096c92 (patch)
tree4ceb6b2a73ffa7525588029614eb1b437a8c04d3
parent9eb296572ec801c32d86b349ba1de27704953237 (diff)
downloadffmpeg-11d1ca4b2c406bee2d22b04268a43b0873096c92.tar.gz
Use avcodec_free_frame() to free AVFrames.
-rw-r--r--avconv.c4
-rw-r--r--avplay.c4
-rw-r--r--libavcodec/api-example.c8
-rw-r--r--libavfilter/vsrc_movie.c2
-rw-r--r--libavformat/output-example.c1
5 files changed, 10 insertions, 9 deletions
diff --git a/avconv.c b/avconv.c
index df09b21c78..0b703edd3c 100644
--- a/avconv.c
+++ b/avconv.c
@@ -180,11 +180,11 @@ void exit_program(int ret)
bsfc = next;
}
output_streams[i]->bitstream_filters = NULL;
+ avcodec_free_frame(&output_streams[i]->filtered_frame);
av_freep(&output_streams[i]->forced_keyframes);
av_freep(&output_streams[i]->avfilter);
av_freep(&output_streams[i]->logfile_prefix);
- av_freep(&output_streams[i]->filtered_frame);
av_freep(&output_streams[i]);
}
for (i = 0; i < nb_input_files; i++) {
@@ -192,7 +192,7 @@ void exit_program(int ret)
av_freep(&input_files[i]);
}
for (i = 0; i < nb_input_streams; i++) {
- av_freep(&input_streams[i]->decoded_frame);
+ avcodec_free_frame(&input_streams[i]->decoded_frame);
av_dict_free(&input_streams[i]->opts);
free_buffer_pool(&input_streams[i]->buffer_pool);
av_freep(&input_streams[i]->filters);
diff --git a/avplay.c b/avplay.c
index a0b0e5bc56..d47cf9439a 100644
--- a/avplay.c
+++ b/avplay.c
@@ -1704,7 +1704,7 @@ static int video_thread(void *arg)
avfilter_graph_free(&graph);
#endif
av_free_packet(&pkt);
- av_free(frame);
+ avcodec_free_frame(&frame);
return 0;
}
@@ -2191,7 +2191,7 @@ static void stream_component_close(VideoState *is, int stream_index)
avresample_free(&is->avr);
av_freep(&is->audio_buf1);
is->audio_buf = NULL;
- av_freep(&is->frame);
+ avcodec_free_frame(&is->frame);
if (is->rdft) {
av_rdft_end(is->rdft);
diff --git a/libavcodec/api-example.c b/libavcodec/api-example.c
index d0253542dd..62750804ba 100644
--- a/libavcodec/api-example.c
+++ b/libavcodec/api-example.c
@@ -212,7 +212,7 @@ static void audio_encode_example(const char *filename)
fclose(f);
av_freep(&samples);
- av_freep(&frame);
+ avcodec_free_frame(&frame);
avcodec_close(c);
av_free(c);
}
@@ -308,7 +308,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
avcodec_close(c);
av_free(c);
- av_free(decoded_frame);
+ avcodec_free_frame(&decoded_frame);
}
/*
@@ -432,7 +432,7 @@ static void video_encode_example(const char *filename)
avcodec_close(c);
av_free(c);
av_freep(&picture->data[0]);
- av_free(picture);
+ avcodec_free_frame(&picture);
printf("\n");
}
@@ -568,7 +568,7 @@ static void video_decode_example(const char *outfilename, const char *filename)
avcodec_close(c);
av_free(c);
- av_free(picture);
+ avcodec_free_frame(&picture);
printf("\n");
}
diff --git a/libavfilter/vsrc_movie.c b/libavfilter/vsrc_movie.c
index aeab10235c..78e1642bac 100644
--- a/libavfilter/vsrc_movie.c
+++ b/libavfilter/vsrc_movie.c
@@ -197,7 +197,7 @@ static av_cold void uninit(AVFilterContext *ctx)
if (movie->format_ctx)
avformat_close_input(&movie->format_ctx);
avfilter_unref_buffer(movie->picref);
- av_freep(&movie->frame);
+ avcodec_free_frame(&movie->frame);
}
static int query_formats(AVFilterContext *ctx)
diff --git a/libavformat/output-example.c b/libavformat/output-example.c
index 27950a162b..1011c2c645 100644
--- a/libavformat/output-example.c
+++ b/libavformat/output-example.c
@@ -165,6 +165,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st)
fprintf(stderr, "Error while writing audio frame\n");
exit(1);
}
+ avcodec_free_frame(&frame);
}
static void close_audio(AVFormatContext *oc, AVStream *st)