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
523 av_dict_free(&output_files[i].opts);523 av_dict_free(&output_files[i].opts);
524 }524 }
525 for(i=0;i<nb_input_files;i++) {525 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);
527 }527 }
528 for (i = 0; i < nb_input_streams; i++) {528 for (i = 0; i < nb_input_streams; i++) {
529 av_freep(&input_streams[i].decoded_frame);529 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
3023 ret = avformat_find_stream_info(ic, opts);3023 ret = avformat_find_stream_info(ic, opts);
3024 if (ret < 0) {3024 if (ret < 0) {
3025 av_log(NULL, AV_LOG_FATAL, "%s: could not find codec parameters\n", filename);3025 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);
3027 exit_program(1);3027 exit_program(1);
3028 }3028 }
3029 3029
avplay.c+1−2
@@ -2593,8 +2593,7 @@ static int decode_thread(void *arg) · 2592 unmodified lines
2593 if (is->subtitle_stream >= 0)2593 if (is->subtitle_stream >= 0)
2594 stream_component_close(is, is->subtitle_stream);2594 stream_component_close(is, is->subtitle_stream);
2595 if (is->ic) {2595 if (is->ic) {
2596 av_close_input_file(is->ic);2596 avformat_close_input(&is->ic);
2597 is->ic = NULL; /* safety */
2598 }2597 }
2599 avio_set_interrupt_cb(NULL);2598 avio_set_interrupt_cb(NULL);
2600 2599
avprobe.c+1−1
@@ -325,7 +325,7 @@ static int probe_file(const char *filename) · 324 unmodified lines
325 if (do_show_format)325 if (do_show_format)
326 show_format(fmt_ctx);326 show_format(fmt_ctx);
327 327
328 av_close_input_file(fmt_ctx);328 avformat_close_input(&fmt_ctx);
329 return 0;329 return 0;
330}330}
331 331
avserver.c+8−9
@@ -849,7 +849,7 @@ static void close_connection(HTTPContext *c) · 848 unmodified lines
849 if (st->codec->codec)849 if (st->codec->codec)
850 avcodec_close(st->codec);850 avcodec_close(st->codec);
851 }851 }
852 av_close_input_file(c->fmt_in);852 avformat_close_input(&c->fmt_in);
853 }853 }
854 854
855 /* free RTP output streams if any */855 /* free RTP output streams if any */
@@ -2169,7 +2169,7 @@ static int open_input_stream(HTTPContext *c, const char *info) · 1313 unmodified lines
2169 c->fmt_in = s;2169 c->fmt_in = s;
2170 if (strcmp(s->iformat->name, "ffm") && avformat_find_stream_info(c->fmt_in, NULL) < 0) {2170 if (strcmp(s->iformat->name, "ffm") && avformat_find_stream_info(c->fmt_in, NULL) < 0) {
2171 http_log("Could not find stream info '%s'\n", input_filename);2171 http_log("Could not find stream info '%s'\n", input_filename);
2172 av_close_input_file(s);2172 avformat_close_input(&s);
2173 return -1;2173 return -1;
2174 }2174 }
2175 2175
@@ -2311,8 +2311,7 @@ static int http_prepare_data(HTTPContext *c) · 135 unmodified lines
2311 return 0;2311 return 0;
2312 } else {2312 } else {
2313 if (c->stream->loop) {2313 if (c->stream->loop) {
2314 av_close_input_file(c->fmt_in);2314 avformat_close_input(&c->fmt_in);
2315 c->fmt_in = NULL;
2316 if (open_input_stream(c, "") < 0)2315 if (open_input_stream(c, "") < 0)
2317 goto no_loop;2316 goto no_loop;
2318 goto redo;2317 goto redo;
@@ -2736,7 +2735,7 @@ static int http_receive_data(HTTPContext *c) · 417 unmodified lines
2736 2735
2737 /* Now we have the actual streams */2736 /* Now we have the actual streams */
2738 if (s->nb_streams != feed->nb_streams) {2737 if (s->nb_streams != feed->nb_streams) {
2739 av_close_input_file(s);2738 avformat_close_input(&s);
2740 av_free(pb);2739 av_free(pb);
2741 http_log("Feed '%s' stream number does not match registered feed\n",2740 http_log("Feed '%s' stream number does not match registered feed\n",
2742 c->stream->feed_filename);2741 c->stream->feed_filename);
@@ -2749,7 +2748,7 @@ static int http_receive_data(HTTPContext *c) · 6 unmodified lines
2749 avcodec_copy_context(fst->codec, st->codec);2748 avcodec_copy_context(fst->codec, st->codec);
2750 }2749 }
2751 2750
2752 av_close_input_file(s);2751 avformat_close_input(&s);
2753 av_free(pb);2752 av_free(pb);
2754 }2753 }
2755 c->buffer_ptr = c->buffer;2754 c->buffer_ptr = c->buffer;
@@ -3629,7 +3628,7 @@ static void build_file_streams(void) · 873 unmodified lines
3629 if (avformat_find_stream_info(infile, NULL) < 0) {3628 if (avformat_find_stream_info(infile, NULL) < 0) {
3630 http_log("Could not find codec parameters from '%s'\n",3629 http_log("Could not find codec parameters from '%s'\n",
3631 stream->feed_filename);3630 stream->feed_filename);
3632 av_close_input_file(infile);3631 avformat_close_input(&infile);
3633 goto fail;3632 goto fail;
3634 }3633 }
3635 extract_mpeg4_header(infile);3634 extract_mpeg4_header(infile);
@@ -3637,7 +3636,7 @@ static void build_file_streams(void) · 1 unmodified line
3637 for(i=0;i<infile->nb_streams;i++)3636 for(i=0;i<infile->nb_streams;i++)
3638 add_av_stream1(stream, infile->streams[i]->codec, 1);3637 add_av_stream1(stream, infile->streams[i]->codec, 1);
3639 3638
3640 av_close_input_file(infile);3639 avformat_close_input(&infile);
3641 }3640 }
3642 }3641 }
3643 }3642 }
@@ -3727,7 +3726,7 @@ static void build_feed_streams(void) · 83 unmodified lines
3727 http_log("Deleting feed file '%s' as stream counts differ (%d != %d)\n",3726 http_log("Deleting feed file '%s' as stream counts differ (%d != %d)\n",
3728 feed->feed_filename, s->nb_streams, feed->nb_streams);3727 feed->feed_filename, s->nb_streams, feed->nb_streams);
3729 3728
3730 av_close_input_file(s);3729 avformat_close_input(&s);
3731 } else3730 } else
3732 http_log("Deleting feed file '%s' as it appears to be corrupt\n",3731 http_log("Deleting feed file '%s' as it appears to be corrupt\n",
3733 feed->feed_filename);3732 feed->feed_filename);
libavfilter/vsrc_movie.c+1−1
@@ -192,7 +192,7 @@ static av_cold void uninit(AVFilterContext *ctx) · 191 unmodified lines
192 if (movie->codec_ctx)192 if (movie->codec_ctx)
193 avcodec_close(movie->codec_ctx);193 avcodec_close(movie->codec_ctx);
194 if (movie->format_ctx)194 if (movie->format_ctx)
195 av_close_input_file(movie->format_ctx);195 avformat_close_input(&movie->format_ctx);
196 avfilter_unref_buffer(movie->picref);196 avfilter_unref_buffer(movie->picref);
197 av_freep(&movie->frame);197 av_freep(&movie->frame);
198}198}
libavformat/applehttp.c+1−1
@@ -132,7 +132,7 @@ static void free_variant_list(AppleHTTPContext *c) · 131 unmodified lines
132 ffurl_close(var->input);132 ffurl_close(var->input);
133 if (var->ctx) {133 if (var->ctx) {
134 var->ctx->pb = NULL;134 var->ctx->pb = NULL;
135 av_close_input_file(var->ctx);135 avformat_close_input(&var->ctx);
136 }136 }
137 av_free(var);137 av_free(var);
138 }138 }
libavformat/avidec.c+1−1
@@ -1365,7 +1365,7 @@ static int avi_read_close(AVFormatContext *s) · 1364 unmodified lines
1365 if (ast) {1365 if (ast) {
1366 if (ast->sub_ctx) {1366 if (ast->sub_ctx) {
1367 av_freep(&ast->sub_ctx->pb);1367 av_freep(&ast->sub_ctx->pb);
1368 av_close_input_file(ast->sub_ctx);1368 avformat_close_input(&ast->sub_ctx);
1369 }1369 }
1370 av_free(ast->sub_buffer);1370 av_free(ast->sub_buffer);
1371 av_free_packet(&ast->sub_pkt);1371 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
368 PESContext *pes = filter->u.pes_filter.opaque;368 PESContext *pes = filter->u.pes_filter.opaque;
369 av_freep(&pes->buffer);369 av_freep(&pes->buffer);
370 /* referenced private data will be freed later in370 /* referenced private data will be freed later in
371 * av_close_input_file */371 * avformat_close_input */
372 if (!((PESContext *)filter->u.pes_filter.opaque)->st) {372 if (!((PESContext *)filter->u.pes_filter.opaque)->st) {
373 av_freep(&filter->u.pes_filter.opaque);373 av_freep(&filter->u.pes_filter.opaque);
374 }374 }
libavformat/rdt.c+1−1
@@ -544,7 +544,7 @@ rdt_free_context (PayloadContext *rdt) · 543 unmodified lines
544 av_freep(&rdt->rmst[i]);544 av_freep(&rdt->rmst[i]);
545 }545 }
546 if (rdt->rmctx)546 if (rdt->rmctx)
547 av_close_input_file(rdt->rmctx);547 avformat_close_input(&rdt->rmctx);
548 av_freep(&rdt->mlti_data);548 av_freep(&rdt->mlti_data);
549 av_freep(&rdt->rmst);549 av_freep(&rdt->rmst);
550 av_free(rdt);550 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
108 "Failed to fix invalid RTSP-MS/ASF min_pktsize\n");108 "Failed to fix invalid RTSP-MS/ASF min_pktsize\n");
109 init_packetizer(&pb, buf, len);109 init_packetizer(&pb, buf, len);
110 if (rt->asf_ctx) {110 if (rt->asf_ctx) {
111 av_close_input_file(rt->asf_ctx);111 avformat_close_input(&rt->asf_ctx);
112 rt->asf_ctx = NULL;
113 }112 }
114 if (!(rt->asf_ctx = avformat_alloc_context()))113 if (!(rt->asf_ctx = avformat_alloc_context()))
115 return AVERROR(ENOMEM);114 return AVERROR(ENOMEM);
libavformat/rtsp.c+1−2
@@ -580,8 +580,7 @@ void ff_rtsp_close_streams(AVFormatContext *s) · 579 unmodified lines
580 }580 }
581 av_free(rt->rtsp_streams);581 av_free(rt->rtsp_streams);
582 if (rt->asf_ctx) {582 if (rt->asf_ctx) {
583 av_close_input_file(rt->asf_ctx);583 avformat_close_input(&rt->asf_ctx);
584 rt->asf_ctx = NULL;
585 }584 }
586 av_free(rt->p);585 av_free(rt->p);
587 av_free(rt->recvbuf);586 av_free(rt->recvbuf);
libavformat/sapdec.c+1−1
@@ -52,7 +52,7 @@ static int sap_read_close(AVFormatContext *s) · 51 unmodified lines
52{52{
53 struct SAPState *sap = s->priv_data;53 struct SAPState *sap = s->priv_data;
54 if (sap->sdp_ctx)54 if (sap->sdp_ctx)
55 av_close_input_file(sap->sdp_ctx);55 avformat_close_input(&sap->sdp_ctx);
56 if (sap->ann_fd)56 if (sap->ann_fd)
57 ffurl_close(sap->ann_fd);57 ffurl_close(sap->ann_fd);
58 av_freep(&sap->sdp);58 av_freep(&sap->sdp);
libavformat/seek-test.c+1−1
@@ -127,7 +127,7 @@ int main(int argc, char **argv) · 126 unmodified lines
127 printf("ret:%-10s st:%2d flags:%d ts:%s\n", ret_str(ret), stream_id, i&1, ts_buf);127 printf("ret:%-10s st:%2d flags:%d ts:%s\n", ret_str(ret), stream_id, i&1, ts_buf);
128 }128 }
129 129
130 av_close_input_file(ic);130 avformat_close_input(&ic);
131 131
132 return 0;132 return 0;
133}133}
tools/pktdumper.c+1−1
@@ -117,7 +117,7 @@ int main(int argc, char **argv) · 116 unmodified lines
117 break;117 break;
118 }118 }
119 119
120 av_close_input_file(fctx);120 avformat_close_input(&fctx);
121 121
122 while (donotquit)122 while (donotquit)
123 sleep(60);123 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