mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
lavf: add new struct for data private to generic layer
Trivial for now, will become more useful in future commits, as many fields from FFFormatContext should not be visible to individual (de)muxers.
This commit is contained in:
parent
461a359abc
commit
772911d3a8
@ -28,6 +28,16 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
typedef struct FormatContextInternal {
|
||||
FFFormatContext fc;
|
||||
} FormatContextInternal;
|
||||
|
||||
static av_always_inline FormatContextInternal *ff_fc_internal(AVFormatContext *s)
|
||||
{
|
||||
return (FormatContextInternal*)s;
|
||||
}
|
||||
|
||||
#define RELATIVE_TS_BASE (INT64_MAX - (1LL << 48))
|
||||
|
||||
|
@ -161,12 +161,15 @@ static int io_close2_default(AVFormatContext *s, AVIOContext *pb)
|
||||
|
||||
AVFormatContext *avformat_alloc_context(void)
|
||||
{
|
||||
FFFormatContext *const si = av_mallocz(sizeof(*si));
|
||||
FormatContextInternal *fci;
|
||||
FFFormatContext *si;
|
||||
AVFormatContext *s;
|
||||
|
||||
if (!si)
|
||||
fci = av_mallocz(sizeof(*fci));
|
||||
if (!fci)
|
||||
return NULL;
|
||||
|
||||
si = &fci->fc;
|
||||
s = &si->pub;
|
||||
s->av_class = &av_format_context_class;
|
||||
s->io_open = io_open_default;
|
||||
|
Loading…
Reference in New Issue
Block a user