Those streams should never get any packets by definition.
AVDictionary *metadata;
} AVChapter;
+typedef struct AVFormatInternal AVFormatInternal;
+
/**
* Format I/O context.
* New fields can be added to the end with minor version bumps.
*/
AVRational offset_timebase;
+ /**
+ * An opaque field for libavformat internal usage.
+ * Must not be accessed in any way by callers.
+ */
+ AVFormatInternal *internal;
} AVFormatContext;
typedef struct AVPacketList {
enum AVCodecID id;
} CodecMime;
+struct AVFormatInternal {
+ /**
+ * Number of streams relevant for interleaving.
+ * Muxing only.
+ */
+ int nb_interleaved_streams;
+};
+
void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem);
#ifdef __GNUC__
av_log(s, AV_LOG_WARNING,
"Codec for stream %d does not use global headers "
"but container format requires global headers\n", i);
+
+ if (codec->codec_type != AVMEDIA_TYPE_ATTACHMENT)
+ s->internal->nb_interleaved_streams++;
}
if (!s->priv_data && of->priv_data_size > 0) {
for (i = 0; i < s->nb_streams; i++)
stream_count += !!s->streams[i]->last_in_packet_buffer;
- if (stream_count && (s->nb_streams == stream_count || flush)) {
+ if (stream_count && (s->internal->nb_interleaved_streams == stream_count || flush)) {
pktl = s->packet_buffer;
*out = pktl->pkt;
*/
#include "avformat.h"
#include "avio_internal.h"
+#include "internal.h"
#include "libavutil/opt.h"
/**
ic = av_malloc(sizeof(AVFormatContext));
if (!ic) return ic;
avformat_get_context_defaults(ic);
+
+ ic->internal = av_mallocz(sizeof(*ic->internal));
+ if (!ic->internal) {
+ avformat_free_context(ic);
+ return NULL;
+ }
+
return ic;
}
av_freep(&s->chapters);
av_dict_free(&s->metadata);
av_freep(&s->streams);
+ av_freep(&s->internal);
av_free(s);
}