Do this by allocating AVFormatContext together with the data that is
currently in AVFormatInternal; or rather: Put AVFormatContext at the
beginning of a new structure called FFFormatContext (which encompasses
more than just the internal fields and is a proper context in its own
right, hence the name) and remove AVFormatInternal altogether.
The biggest simplifications occured in avformat_alloc_context(), where
one can now simply call avformat_free_context() in case of errors.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This is possible now that the next-API is gone.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
By using the frame counter (and the video time base) for audio pts we lose some
timestamp precision but we ensure that video and audio coming from the same DV
frame are always in sync.
This patch also makes timestamps after seek consistent and it should also fix
the timestamps when the audio clock is unlocked and have a completely
indpendent clock source. (E.g. runs on fixed 48009 Hz which should have been
exact 48000 Hz)
Fixes out of sync timestamps in ticket #8762.
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit avoids allocating a DVDemuxContext when demuxing raw DV by
making it part of the demuxer's context. This also allows to remove
dv_read_close().
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Also propagate proper AVERROR codes while at it.
Fixes ticket #8230.
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
dv_frame_offset() is static and called only from dv_read_seek(), where
c->sys->frame_size is already used.
This simplifies the incoming codecpar merge where
avctx->{coded_width,coded_height,time_base} are not accessible anymore.
Currently, AVStream contains an embedded AVCodecContext instance, which
is used by demuxers to export stream parameters to the caller and by
muxers to receive stream parameters from the caller. It is also used
internally as the codec context that is passed to parsers.
In addition, it is also widely used by the callers as the decoding (when
demuxer) or encoding (when muxing) context, though this has been
officially discouraged since Libav 11.
There are multiple important problems with this approach:
- the fields in AVCodecContext are in general one of
* stream parameters
* codec options
* codec state
However, it's not clear which ones are which. It is consequently
unclear which fields are a demuxer allowed to set or a muxer allowed to
read. This leads to erratic behaviour depending on whether decoding or
encoding is being performed or not (and whether it uses the AVStream
embedded codec context).
- various synchronization issues arising from the fact that the same
context is used by several different APIs (muxers/demuxers,
parsers, bitstream filters and encoders/decoders) simultaneously, with
there being no clear rules for who can modify what and the different
processes being typically delayed with respect to each other.
- avformat_find_stream_info() making it necessary to support opening
and closing a single codec context multiple times, thus
complicating the semantics of freeing various allocated objects in the
codec context.
Those problems are resolved by replacing the AVStream embedded codec
context with a newly added AVCodecParameters instance, which stores only
the stream parameters exported by the demuxers or read by the muxers.
Fixes Ticket2340
Fixes Ticket2341
Based-on mail from Dave Rice <dave@dericed.com>
Tested-by: Dave Rice <dave@dericed.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'f6ee61fb05482c617f5deee29a190d8ff483b3d1':
lavc: export DV profile API used by muxer/demuxer as public
Conflicts:
configure
doc/APIchanges
libavcodec/Makefile
libavcodec/dv_profile.c
libavcodec/dv_profile.h
libavcodec/version.h
libavformat/dvenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '79f2c426fde6e71c40b29504112d0528b85be623':
dv: do not set codec timebase
Conflicts:
libavformat/dv.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '3cbe1126530449336e2ce59b194bdb8c4eb4abb4':
dv: Split DV data table declarations into their own header
Conflicts:
libavcodec/dvdata.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This is necessary to avoid target config settings bleeding into the host
compilation process with hardcoded tables and the DV VLC tables no longer
present as static tables in a header file.
* commit '7ee191cab0dc44700f26c5784e2adeb6a779651b':
dv: Add a guard to not overread the ppcm array
See: 3669915e93
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'ef1b23ad21e3f12fc4ff2a73a6d4d4cd9d630c4b': (21 commits)
jvdec: set channel layout
iss: set channel layout
ipmovie: set channel layout
iff: set channel layout
idroqdec: set channel layout
gxfdec: set channel layout when applicable
gsmdec: set channel layout
flvdec: set channel layout
dv: set channel layout
dsicin: set channel layout
daud: set channel layout
cdxl: set channel layout
bmv: set channel layout
bink: set channel layout
bfi: set channel layout
bethsoftvid: set channel layout
apc: set channel layout
amr: set channel_layout
ppc: replace pointer casting with AV_COPY32
ppc: fix some unused variable warnings
...
Conflicts:
libavformat/amr.c
libavformat/iff.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '14f031d7ecfabba0ef02776d4516aa3dcb7c40d8':
dv: use AVStream.index instead of abusing AVStream.id
lavfi: add ashowinfo filter
avcodec: Add a RFC 3389 comfort noise codec
lpc: Add a function for calculating reflection coefficients from samples
lpc: Add a function for calculating reflection coefficients from autocorrelation coefficients
lavr: document upper bound on number of output samples.
lavr: add general API usage doxy
indeo3: remove duplicate capabilities line.
fate: ac3: Add dependencies
Conflicts:
Changelog
doc/filters.texi
libavcodec/Makefile
libavcodec/allcodecs.c
libavcodec/avcodec.h
libavcodec/codec_desc.c
libavcodec/version.h
libavfilter/Makefile
libavfilter/af_ashowinfo.c
libavfilter/allfilters.c
libavfilter/version.h
libavutil/avutil.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>