History

Use avcodec_free_frame() to free AVFrames.

Anton Khirnov committed 14 years ago

Commit 11d1ca41 parent 9eb29655 files · +10 −9Browse files

Unified · Split

5 files
  1. avconv.c +2 −2
  2. avplay.c +2 −2
  3. libavcodec/api-example.c +4 −4
  4. libavfilter/vsrc_movie.c +1 −1
  5. libavformat/output-example.c +1 −0
avconv.c+2−2
@@ -180,11 +180,11 @@ void exit_program(int ret) · 179 unmodified lines
180180 bsfc = next;
181181 }
182182 output_streams[i]->bitstream_filters = NULL;
183+ avcodec_free_frame(&output_streams[i]->filtered_frame);
183184
184185 av_freep(&output_streams[i]->forced_keyframes);
185186 av_freep(&output_streams[i]->avfilter);
186187 av_freep(&output_streams[i]->logfile_prefix);
187− av_freep(&output_streams[i]->filtered_frame);
188188 av_freep(&output_streams[i]);
189189 }
190190 for (i = 0; i < nb_input_files; i++) {
@@ -192,7 +192,7 @@ void exit_program(int ret) · 1 unmodified line
192192 av_freep(&input_files[i]);
193193 }
194194 for (i = 0; i < nb_input_streams; i++) {
195− av_freep(&input_streams[i]->decoded_frame);
195+ avcodec_free_frame(&input_streams[i]->decoded_frame);
196196 av_dict_free(&input_streams[i]->opts);
197197 free_buffer_pool(&input_streams[i]->buffer_pool);
198198 av_freep(&input_streams[i]->filters);
avplay.c+2−2
@@ -1704,7 +1704,7 @@ static int video_thread(void *arg) · 1703 unmodified lines
17041704 avfilter_graph_free(&graph);
17051705 #endif
17061706 av_free_packet(&pkt);
1707− av_free(frame);
1707+ avcodec_free_frame(&frame);
17081708 return 0;
17091709 }
17101710
@@ -2191,7 +2191,7 @@ static void stream_component_close(VideoState *is, int stream_index) · 480 unmodified lines
21912191 avresample_free(&is->avr);
21922192 av_freep(&is->audio_buf1);
21932193 is->audio_buf = NULL;
2194− av_freep(&is->frame);
2194+ avcodec_free_frame(&is->frame);
21952195
21962196 if (is->rdft) {
21972197 av_rdft_end(is->rdft);
libavcodec/api-example.c+4−4
@@ -212,7 +212,7 @@ static void audio_encode_example(const char *filename) · 211 unmodified lines
212212 fclose(f);
213213
214214 av_freep(&samples);
215− av_freep(&frame);
215+ avcodec_free_frame(&frame);
216216 avcodec_close(c);
217217 av_free(c);
218218 }
@@ -308,7 +308,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 89 unmodified lines
308308
309309 avcodec_close(c);
310310 av_free(c);
311− av_free(decoded_frame);
311+ avcodec_free_frame(&decoded_frame);
312312 }
313313
314314 /*
@@ -432,7 +432,7 @@ static void video_encode_example(const char *filename) · 117 unmodified lines
432432 avcodec_close(c);
433433 av_free(c);
434434 av_freep(&picture->data[0]);
435− av_free(picture);
435+ avcodec_free_frame(&picture);
436436 printf("\n");
437437 }
438438
@@ -568,7 +568,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 129 unmodified lines
568568
569569 avcodec_close(c);
570570 av_free(c);
571− av_free(picture);
571+ avcodec_free_frame(&picture);
572572 printf("\n");
573573 }
574574
libavfilter/vsrc_movie.c+1−1
@@ -197,7 +197,7 @@ static av_cold void uninit(AVFilterContext *ctx) · 196 unmodified lines
197197 if (movie->format_ctx)
198198 avformat_close_input(&movie->format_ctx);
199199 avfilter_unref_buffer(movie->picref);
200− av_freep(&movie->frame);
200+ avcodec_free_frame(&movie->frame);
201201 }
202202
203203 static int query_formats(AVFilterContext *ctx)
libavformat/output-example.c+1−0
@@ -165,6 +165,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st) · 164 unmodified lines
165165 fprintf(stderr, "Error while writing audio frame\n");
166166 exit(1);
167167 }
168+ avcodec_free_frame(&frame);
168169 }
169170
170171 static void close_audio(AVFormatContext *oc, AVStream *st)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t