[FFmpeg-cvslog] r25382 - in trunk/libavformat: avformat.h utils.c

aurel subversion
Wed Oct 6 23:43:47 CEST 2010


Author: aurel
Date: Wed Oct  6 23:43:46 2010
New Revision: 25382

Log:
properly check for FF_API_MAX_STREAMS instead of LIBAVFORMAT_VERSION_MAJOR

Modified:
   trunk/libavformat/avformat.h
   trunk/libavformat/utils.c

Modified: trunk/libavformat/avformat.h
==============================================================================
--- trunk/libavformat/avformat.h	Wed Oct  6 22:56:14 2010	(r25381)
+++ trunk/libavformat/avformat.h	Wed Oct  6 23:43:46 2010	(r25382)
@@ -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;

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	Wed Oct  6 22:56:14 2010	(r25381)
+++ trunk/libavformat/utils.c	Wed Oct  6 23:43:46 2010	(r25382)
@@ -2543,7 +2543,13 @@ AVStream *av_new_stream(AVFormatContext 
 {
     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 
     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));



More information about the ffmpeg-cvslog mailing list