History

avformat: make avformat_close_input() more tolerant.

The purpose of this commit is to make error management simpler and less error prone, just like av_free() which is safe with NULL.

Clément Bœsch committed 13 years ago

Commit 36cd0171 parent bc689273 files · +12 −3Browse files

Unified · Split

3 files
  1. doc/APIchanges +3 −0
  2. libavformat/utils.c +8 −2
  3. libavformat/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2012-10-22 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182013-xx-xx - xxxxxxx - lavf 55.16.101 - avformat.h
19 avformat_close_input() argument can be NULL and point on NULL.
20
182013-08-29 - e31db62 - lavf 55.15.100 - avformat.h212013-08-29 - e31db62 - lavf 55.15.100 - avformat.h
19 Add av_format_get_probe_score().22 Add av_format_get_probe_score().
20 23
libavformat/utils.c+8−2
@@ -3252,8 +3252,14 @@ void av_close_input_file(AVFormatContext *s) · 3251 unmodified lines
3252 3252
3253void avformat_close_input(AVFormatContext **ps)3253void avformat_close_input(AVFormatContext **ps)
3254{3254{
3255 AVFormatContext *s = *ps;3255 AVFormatContext *s;
3256 AVIOContext *pb = s->pb;3256 AVIOContext *pb;
3257
3258 if (!ps || !*ps)
3259 return;
3260
3261 s = *ps;
3262 pb = s->pb;
3257 3263
3258 if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||3264 if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
3259 (s->flags & AVFMT_FLAG_CUSTOM_IO))3265 (s->flags & AVFMT_FLAG_CUSTOM_IO))
libavformat/version.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31 31
32#define LIBAVFORMAT_VERSION_MAJOR 5532#define LIBAVFORMAT_VERSION_MAJOR 55
33#define LIBAVFORMAT_VERSION_MINOR 1633#define LIBAVFORMAT_VERSION_MINOR 16
34#define LIBAVFORMAT_VERSION_MICRO 10034#define LIBAVFORMAT_VERSION_MICRO 101
35 35
36#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \36#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
37 LIBAVFORMAT_VERSION_MINOR, \37 LIBAVFORMAT_VERSION_MINOR, \

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