| 375 | } |
| 376 | |
| 377 | void avformat_close_input(AVFormatContext **ps) |
| 378 | { |
| 379 | AVFormatContext *s; |
| 380 | AVIOContext *pb; |
| 381 | |
| 382 | if (!ps || !*ps) |
| 383 | return; |
| 384 | |
| 385 | s = *ps; |
| 386 | pb = s->pb; |
| 387 | |
| 388 | if ((s->iformat && strcmp(s->iformat->name, "image2") && s->iformat->flags & AVFMT_NOFILE) || |
| 389 | (s->flags & AVFMT_FLAG_CUSTOM_IO)) |
| 390 | pb = NULL; |
| 391 | |
| 392 | if (s->iformat) |
| 393 | if (ffifmt(s->iformat)->read_close) |
| 394 | ffifmt(s->iformat)->read_close(s); |
| 395 | |
| 396 | ff_format_io_close(s, &pb); |
| 397 | avformat_free_context(s); |
| 398 | |
| 399 | *ps = NULL; |
| 400 | } |
| 401 | |
| 402 | static void force_codec_ids(AVFormatContext *s, AVStream *st) |
| 403 | { |