Commit 761ad429 authored by Anton Khirnov's avatar Anton Khirnov

lavf: remove FF_API_MAX_STREAMS cruft

parent aad2f2f4
...@@ -106,9 +106,7 @@ typedef struct AVChapterMap { ...@@ -106,9 +106,7 @@ typedef struct AVChapterMap {
static const OptionDef options[]; static const OptionDef options[];
#define MAX_FILES 100 #define MAX_FILES 100
#if !FF_API_MAX_STREAMS
#define MAX_STREAMS 1024 /* arbitrary sanity check value */ #define MAX_STREAMS 1024 /* arbitrary sanity check value */
#endif
#define FFM_PACKET_SIZE 4096 //XXX a duplicate of the line in ffm.h #define FFM_PACKET_SIZE 4096 //XXX a duplicate of the line in ffm.h
......
...@@ -95,9 +95,7 @@ static const char *http_state[] = { ...@@ -95,9 +95,7 @@ static const char *http_state[] = {
"RTSP_SEND_PACKET", "RTSP_SEND_PACKET",
}; };
#if !FF_API_MAX_STREAMS
#define MAX_STREAMS 20 #define MAX_STREAMS 20
#endif
#define IOBUFFER_INIT_SIZE 8192 #define IOBUFFER_INIT_SIZE 8192
...@@ -2944,11 +2942,9 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, ...@@ -2944,11 +2942,9 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
snprintf(avc->filename, 1024, "rtp://0.0.0.0"); snprintf(avc->filename, 1024, "rtp://0.0.0.0");
} }
#if !FF_API_MAX_STREAMS
if (avc->nb_streams >= INT_MAX/sizeof(*avc->streams) || if (avc->nb_streams >= INT_MAX/sizeof(*avc->streams) ||
!(avc->streams = av_malloc(avc->nb_streams * sizeof(*avc->streams)))) !(avc->streams = av_malloc(avc->nb_streams * sizeof(*avc->streams))))
goto sdp_done; goto sdp_done;
#endif
if (avc->nb_streams >= INT_MAX/sizeof(*avs) || if (avc->nb_streams >= INT_MAX/sizeof(*avs) ||
!(avs = av_malloc(avc->nb_streams * sizeof(*avs)))) !(avs = av_malloc(avc->nb_streams * sizeof(*avs))))
goto sdp_done; goto sdp_done;
...@@ -2961,9 +2957,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, ...@@ -2961,9 +2957,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
av_sdp_create(&avc, 1, *pbuffer, 2048); av_sdp_create(&avc, 1, *pbuffer, 2048);
sdp_done: sdp_done:
#if !FF_API_MAX_STREAMS
av_free(avc->streams); av_free(avc->streams);
#endif
av_metadata_free(&avc->metadata); av_metadata_free(&avc->metadata);
av_free(avc); av_free(avc);
av_free(avs); av_free(avs);
......
...@@ -672,10 +672,6 @@ typedef struct AVChapter { ...@@ -672,10 +672,6 @@ typedef struct AVChapter {
AVMetadata *metadata; AVMetadata *metadata;
} AVChapter; } AVChapter;
#if FF_API_MAX_STREAMS
#define MAX_STREAMS 20
#endif
/** /**
* Format I/O context. * Format I/O context.
* New fields can be added to the end with minor version bumps. * New fields can be added to the end with minor version bumps.
...@@ -691,11 +687,7 @@ typedef struct AVFormatContext { ...@@ -691,11 +687,7 @@ typedef struct AVFormatContext {
void *priv_data; void *priv_data;
AVIOContext *pb; AVIOContext *pb;
unsigned int nb_streams; unsigned int nb_streams;
#if FF_API_MAX_STREAMS
AVStream *streams[MAX_STREAMS];
#else
AVStream **streams; AVStream **streams;
#endif
char filename[1024]; /**< input or output filename */ char filename[1024]; /**< input or output filename */
/* stream info */ /* stream info */
int64_t timestamp; int64_t timestamp;
......
...@@ -24,11 +24,7 @@ ...@@ -24,11 +24,7 @@
#include "asf.h" #include "asf.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#if FF_API_MAX_STREAMS
#define MMS_MAX_STREAMS MAX_STREAMS
#else
#define MMS_MAX_STREAMS 256 /**< arbitrary sanity check value */ #define MMS_MAX_STREAMS 256 /**< arbitrary sanity check value */
#endif
int ff_mms_read_header(MMSContext *mms, uint8_t *buf, const int size) int ff_mms_read_header(MMSContext *mms, uint8_t *buf, const int size)
{ {
......
...@@ -675,11 +675,6 @@ static int mpegts_push_data(MpegTSFilter *filter, ...@@ -675,11 +675,6 @@ static int mpegts_push_data(MpegTSFilter *filter,
code == 0x1be) /* padding_stream */ code == 0x1be) /* padding_stream */
goto skip; goto skip;
#if FF_API_MAX_STREAMS
if (!pes->st && pes->stream->nb_streams == MAX_STREAMS)
goto skip;
#endif
/* stream not present in PMT */ /* stream not present in PMT */
if (!pes->st) { if (!pes->st) {
pes->st = av_new_stream(ts->stream, pes->pid); pes->st = av_new_stream(ts->stream, pes->pid);
......
...@@ -30,11 +30,7 @@ ...@@ -30,11 +30,7 @@
#undef NDEBUG #undef NDEBUG
#include <assert.h> #include <assert.h>
#if FF_API_MAX_STREAMS
#define NUT_MAX_STREAMS MAX_STREAMS
#else
#define NUT_MAX_STREAMS 256 /* arbitrary sanity check value */ #define NUT_MAX_STREAMS 256 /* arbitrary sanity check value */
#endif
static int get_str(AVIOContext *bc, char *string, unsigned int maxlen){ static int get_str(AVIOContext *bc, char *string, unsigned int maxlen){
unsigned int len= ffio_read_varlen(bc); unsigned int len= ffio_read_varlen(bc);
......
...@@ -2660,13 +2660,6 @@ AVStream *av_new_stream(AVFormatContext *s, int id) ...@@ -2660,13 +2660,6 @@ AVStream *av_new_stream(AVFormatContext *s, int id)
{ {
AVStream *st; AVStream *st;
int i; int i;
#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; AVStream **streams;
if (s->nb_streams >= INT_MAX/sizeof(*streams)) if (s->nb_streams >= INT_MAX/sizeof(*streams))
...@@ -2675,7 +2668,6 @@ AVStream *av_new_stream(AVFormatContext *s, int id) ...@@ -2675,7 +2668,6 @@ AVStream *av_new_stream(AVFormatContext *s, int id)
if (!streams) if (!streams)
return NULL; return NULL;
s->streams = streams; s->streams = streams;
#endif
st = av_mallocz(sizeof(AVStream)); st = av_mallocz(sizeof(AVStream));
if (!st) if (!st)
......
...@@ -41,9 +41,6 @@ ...@@ -41,9 +41,6 @@
* Those FF_API_* defines are not part of public API. * Those FF_API_* defines are not part of public API.
* They may change, break or disappear at any time. * They may change, break or disappear at any time.
*/ */
#ifndef FF_API_MAX_STREAMS
#define FF_API_MAX_STREAMS (LIBAVFORMAT_VERSION_MAJOR < 53)
#endif
#ifndef FF_API_OLD_METADATA #ifndef FF_API_OLD_METADATA
#define FF_API_OLD_METADATA (LIBAVFORMAT_VERSION_MAJOR < 53) #define FF_API_OLD_METADATA (LIBAVFORMAT_VERSION_MAJOR < 53)
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment