aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2010-10-06 21:43:46 +0000
committerAurelien Jacobs <aurel@gnuage.org>2010-10-06 21:43:46 +0000
commit61138c43e08b7bb039fbcf50f1e71d6e735e04a5 (patch)
tree3c305463ea61d6f36fb43da76d967e5a2e666f8e /libavformat
parent38aab35f47c3c7a559c3180568695c6ad21d62ac (diff)
downloadffmpeg-61138c43e08b7bb039fbcf50f1e71d6e735e04a5.tar.gz
properly check for FF_API_MAX_STREAMS instead of LIBAVFORMAT_VERSION_MAJOR
Originally committed as revision 25382 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avformat.h2
-rw-r--r--libavformat/utils.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 4a46a36789..b08f758d0f 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -672,7 +672,7 @@ typedef struct AVFormatContext {
void *priv_data;
ByteIOContext *pb;
unsigned int nb_streams;
-#if LIBAVFORMAT_VERSION_MAJOR < 53
+#if FF_API_MAX_STREAMS
AVStream *streams[MAX_STREAMS];
#else
AVStream **streams;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 73f89a0a0f..1b58b342bb 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2543,7 +2543,13 @@ AVStream *av_new_stream(AVFormatContext *s, int id)
{
AVStream *st;
int i;
-#if LIBAVFORMAT_VERSION_MAJOR >= 53
+
+#if FF_API_MAX_STREAMS
+ if (s->nb_streams >= MAX_STREAMS){
+ av_log(s, AV_LOG_ERROR, "Too many streams\n");
+ return NULL;
+ }
+#else
AVStream **streams;
if (s->nb_streams >= INT_MAX/sizeof(*streams))
@@ -2552,11 +2558,6 @@ AVStream *av_new_stream(AVFormatContext *s, int id)
if (!streams)
return NULL;
s->streams = streams;
-#else
- if (s->nb_streams >= MAX_STREAMS){
- av_log(s, AV_LOG_ERROR, "Too many streams\n");
- return NULL;
- }
#endif
st = av_mallocz(sizeof(AVStream));