aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2010-10-06 20:56:14 +0000
committerAurelien Jacobs <aurel@gnuage.org>2010-10-06 20:56:14 +0000
commit38aab35f47c3c7a559c3180568695c6ad21d62ac (patch)
tree0a4d9b90c2ce5049428020f51cbea516438cabd5 /libavformat/utils.c
parentfeb2440c38c7bde97b04e3ad32575e50cb85c826 (diff)
downloadffmpeg-38aab35f47c3c7a559c3180568695c6ad21d62ac.tar.gz
add new streams API without MAX_STREAMS limit
(disabled until next major bump) Originally committed as revision 25381 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 2776a0ff05..73f89a0a0f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2543,11 +2543,21 @@ AVStream *av_new_stream(AVFormatContext *s, int id)
{
AVStream *st;
int i;
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
+ AVStream **streams;
+ if (s->nb_streams >= INT_MAX/sizeof(*streams))
+ return NULL;
+ streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));
+ 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));
if (!st)