History

Replace all uses of av_close_input_file() with avformat_close_input().

Anton Khirnov committed 14 years ago

Commit cd3716b1 parent 526604514 files · +22 −26Browse files

Unified · Split

14 files
  1. avconv.c +2 −2
  2. avplay.c +1 −2
  3. avprobe.c +1 −1
  4. avserver.c +8 −9
  5. libavfilter/vsrc_movie.c +1 −1
  6. libavformat/applehttp.c +1 −1
  7. libavformat/avidec.c +1 −1
  8. libavformat/mpegts.c +1 −1
  9. libavformat/rdt.c +1 −1
  10. libavformat/rtpdec_asf.c +1 −2
  11. libavformat/rtsp.c +1 −2
  12. libavformat/sapdec.c +1 −1
  13. libavformat/seek-test.c +1 −1
  14. tools/pktdumper.c +1 −1
avconv.c+2−2
@@ -523,7 +523,7 @@ void exit_program(int ret) · 522 unmodified lines
523523 av_dict_free(&output_files[i].opts);
524524 }
525525 for(i=0;i<nb_input_files;i++) {
526− av_close_input_file(input_files[i].ctx);
526+ avformat_close_input(&input_files[i].ctx);
527527 }
528528 for (i = 0; i < nb_input_streams; i++) {
529529 av_freep(&input_streams[i].decoded_frame);
@@ -3023,7 +3023,7 @@ static int opt_input_file(OptionsContext *o, const char *opt, const char *filena · 2493 unmodified lines
30233023 ret = avformat_find_stream_info(ic, opts);
30243024 if (ret < 0) {
30253025 av_log(NULL, AV_LOG_FATAL, "%s: could not find codec parameters\n", filename);
3026− av_close_input_file(ic);
3026+ avformat_close_input(&ic);
30273027 exit_program(1);
30283028 }
30293029
avplay.c+1−2
@@ -2593,8 +2593,7 @@ static int decode_thread(void *arg) · 2592 unmodified lines
25932593 if (is->subtitle_stream >= 0)
25942594 stream_component_close(is, is->subtitle_stream);
25952595 if (is->ic) {
2596− av_close_input_file(is->ic);
2597− is->ic = NULL; /* safety */
2596+ avformat_close_input(&is->ic);
25982597 }
25992598 avio_set_interrupt_cb(NULL);
26002599
avprobe.c+1−1
@@ -325,7 +325,7 @@ static int probe_file(const char *filename) · 324 unmodified lines
325325 if (do_show_format)
326326 show_format(fmt_ctx);
327327
328− av_close_input_file(fmt_ctx);
328+ avformat_close_input(&fmt_ctx);
329329 return 0;
330330 }
331331
avserver.c+8−9
@@ -849,7 +849,7 @@ static void close_connection(HTTPContext *c) · 848 unmodified lines
849849 if (st->codec->codec)
850850 avcodec_close(st->codec);
851851 }
852− av_close_input_file(c->fmt_in);
852+ avformat_close_input(&c->fmt_in);
853853 }
854854
855855 /* free RTP output streams if any */
@@ -2169,7 +2169,7 @@ static int open_input_stream(HTTPContext *c, const char *info) · 1313 unmodified lines
21692169 c->fmt_in = s;
21702170 if (strcmp(s->iformat->name, "ffm") && avformat_find_stream_info(c->fmt_in, NULL) < 0) {
21712171 http_log("Could not find stream info '%s'\n", input_filename);
2172− av_close_input_file(s);
2172+ avformat_close_input(&s);
21732173 return -1;
21742174 }
21752175
@@ -2311,8 +2311,7 @@ static int http_prepare_data(HTTPContext *c) · 135 unmodified lines
23112311 return 0;
23122312 } else {
23132313 if (c->stream->loop) {
2314− av_close_input_file(c->fmt_in);
2315− c->fmt_in = NULL;
2314+ avformat_close_input(&c->fmt_in);
23162315 if (open_input_stream(c, "") < 0)
23172316 goto no_loop;
23182317 goto redo;
@@ -2736,7 +2735,7 @@ static int http_receive_data(HTTPContext *c) · 417 unmodified lines
27362735
27372736 /* Now we have the actual streams */
27382737 if (s->nb_streams != feed->nb_streams) {
2739− av_close_input_file(s);
2738+ avformat_close_input(&s);
27402739 av_free(pb);
27412740 http_log("Feed '%s' stream number does not match registered feed\n",
27422741 c->stream->feed_filename);
@@ -2749,7 +2748,7 @@ static int http_receive_data(HTTPContext *c) · 6 unmodified lines
27492748 avcodec_copy_context(fst->codec, st->codec);
27502749 }
27512750
2752− av_close_input_file(s);
2751+ avformat_close_input(&s);
27532752 av_free(pb);
27542753 }
27552754 c->buffer_ptr = c->buffer;
@@ -3629,7 +3628,7 @@ static void build_file_streams(void) · 873 unmodified lines
36293628 if (avformat_find_stream_info(infile, NULL) < 0) {
36303629 http_log("Could not find codec parameters from '%s'\n",
36313630 stream->feed_filename);
3632− av_close_input_file(infile);
3631+ avformat_close_input(&infile);
36333632 goto fail;
36343633 }
36353634 extract_mpeg4_header(infile);
@@ -3637,7 +3636,7 @@ static void build_file_streams(void) · 1 unmodified line
36373636 for(i=0;i<infile->nb_streams;i++)
36383637 add_av_stream1(stream, infile->streams[i]->codec, 1);
36393638
3640− av_close_input_file(infile);
3639+ avformat_close_input(&infile);
36413640 }
36423641 }
36433642 }
@@ -3727,7 +3726,7 @@ static void build_feed_streams(void) · 83 unmodified lines
37273726 http_log("Deleting feed file '%s' as stream counts differ (%d != %d)\n",
37283727 feed->feed_filename, s->nb_streams, feed->nb_streams);
37293728
3730− av_close_input_file(s);
3729+ avformat_close_input(&s);
37313730 } else
37323731 http_log("Deleting feed file '%s' as it appears to be corrupt\n",
37333732 feed->feed_filename);
libavfilter/vsrc_movie.c+1−1
@@ -192,7 +192,7 @@ static av_cold void uninit(AVFilterContext *ctx) · 191 unmodified lines
192192 if (movie->codec_ctx)
193193 avcodec_close(movie->codec_ctx);
194194 if (movie->format_ctx)
195− av_close_input_file(movie->format_ctx);
195+ avformat_close_input(&movie->format_ctx);
196196 avfilter_unref_buffer(movie->picref);
197197 av_freep(&movie->frame);
198198 }
libavformat/applehttp.c+1−1
@@ -132,7 +132,7 @@ static void free_variant_list(AppleHTTPContext *c) · 131 unmodified lines
132132 ffurl_close(var->input);
133133 if (var->ctx) {
134134 var->ctx->pb = NULL;
135− av_close_input_file(var->ctx);
135+ avformat_close_input(&var->ctx);
136136 }
137137 av_free(var);
138138 }
libavformat/avidec.c+1−1
@@ -1365,7 +1365,7 @@ static int avi_read_close(AVFormatContext *s) · 1364 unmodified lines
13651365 if (ast) {
13661366 if (ast->sub_ctx) {
13671367 av_freep(&ast->sub_ctx->pb);
1368− av_close_input_file(ast->sub_ctx);
1368+ avformat_close_input(&ast->sub_ctx);
13691369 }
13701370 av_free(ast->sub_buffer);
13711371 av_free_packet(&ast->sub_pkt);
libavformat/mpegts.c+1−1
@@ -368,7 +368,7 @@ static void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter) · 367 unmodified lines
368368 PESContext *pes = filter->u.pes_filter.opaque;
369369 av_freep(&pes->buffer);
370370 /* referenced private data will be freed later in
371− * av_close_input_file */
371+ * avformat_close_input */
372372 if (!((PESContext *)filter->u.pes_filter.opaque)->st) {
373373 av_freep(&filter->u.pes_filter.opaque);
374374 }
libavformat/rdt.c+1−1
@@ -544,7 +544,7 @@ rdt_free_context (PayloadContext *rdt) · 543 unmodified lines
544544 av_freep(&rdt->rmst[i]);
545545 }
546546 if (rdt->rmctx)
547− av_close_input_file(rdt->rmctx);
547+ avformat_close_input(&rdt->rmctx);
548548 av_freep(&rdt->mlti_data);
549549 av_freep(&rdt->rmst);
550550 av_free(rdt);
libavformat/rtpdec_asf.c+1−2
@@ -108,8 +108,7 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p) · 107 unmodified lines
108108 "Failed to fix invalid RTSP-MS/ASF min_pktsize\n");
109109 init_packetizer(&pb, buf, len);
110110 if (rt->asf_ctx) {
111− av_close_input_file(rt->asf_ctx);
112− rt->asf_ctx = NULL;
111+ avformat_close_input(&rt->asf_ctx);
113112 }
114113 if (!(rt->asf_ctx = avformat_alloc_context()))
115114 return AVERROR(ENOMEM);
libavformat/rtsp.c+1−2
@@ -580,8 +580,7 @@ void ff_rtsp_close_streams(AVFormatContext *s) · 579 unmodified lines
580580 }
581581 av_free(rt->rtsp_streams);
582582 if (rt->asf_ctx) {
583− av_close_input_file(rt->asf_ctx);
584− rt->asf_ctx = NULL;
583+ avformat_close_input(&rt->asf_ctx);
585584 }
586585 av_free(rt->p);
587586 av_free(rt->recvbuf);
libavformat/sapdec.c+1−1
@@ -52,7 +52,7 @@ static int sap_read_close(AVFormatContext *s) · 51 unmodified lines
5252 {
5353 struct SAPState *sap = s->priv_data;
5454 if (sap->sdp_ctx)
55− av_close_input_file(sap->sdp_ctx);
55+ avformat_close_input(&sap->sdp_ctx);
5656 if (sap->ann_fd)
5757 ffurl_close(sap->ann_fd);
5858 av_freep(&sap->sdp);
libavformat/seek-test.c+1−1
@@ -127,7 +127,7 @@ int main(int argc, char **argv) · 126 unmodified lines
127127 printf("ret:%-10s st:%2d flags:%d ts:%s\n", ret_str(ret), stream_id, i&1, ts_buf);
128128 }
129129
130− av_close_input_file(ic);
130+ avformat_close_input(&ic);
131131
132132 return 0;
133133 }
tools/pktdumper.c+1−1
@@ -117,7 +117,7 @@ int main(int argc, char **argv) · 116 unmodified lines
117117 break;
118118 }
119119
120− av_close_input_file(fctx);
120+ avformat_close_input(&fctx);
121121
122122 while (donotquit)
123123 sleep(60);

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