Commit Graph

33 Commits

Author SHA1 Message Date
Anton Khirnov 9200514ad8 lavf: replace AVStream.codec with AVStream.codecpar
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.
2016-02-23 17:01:58 +01:00
Vittorio Giovara f53583ea6e omadec: Fix position of opening parenthesis 2015-10-30 12:46:56 +01:00
Vittorio Giovara 10de408738 lavf: Update to the new crypto API 2015-09-13 17:34:45 +02:00
Vittorio Giovara 059a934806 lavc: Consistently prefix input buffer defines
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:59 +01:00
Luca Barbato e352520e3e oma: Report a timestamp
Reported-By: jb@videolan.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-02-07 15:36:15 +01:00
Diego Biurrun d92024f18f lavf: more correct printf format specifiers 2014-03-11 13:13:41 +01:00
Maxim Polijakowski e6f0bb6527 ATRAC3+ decoder
Cleanup by Diego Biurrun.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2014-01-09 19:33:07 +01:00
David Goldwich 0a7fef39fc omadec: loosen format probing constraints
Imporoves detection of some files in the wild:

- ID3v2 a.k.a. "ea3" header is optional.
- Version and flags in ID3v2 header are unspecified.

Signed-off-by: David Goldwich <david.goldwich@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-04 18:43:18 +01:00
Michael Niedermayer 1c736bedd9 omadec: check GEOB sizes against buffer size
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-04 18:43:03 +01:00
Michael Niedermayer 97f50e92b5 omadec: Fix wrong number of array elements
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-04 18:38:01 +01:00
Maxim Poliakovski 487b54104a omadec: fix bitrate for ATRAC3+ streams
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-29 21:54:51 +02:00
Maxim Poliakovski 23d0fdcf6f Add support for multichannel ATRAC3+ streams.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-29 21:52:57 +02:00
Martin Storsjö 342c43d154 omadec: Properly check lengths before incrementing the position
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 11:04:52 +03:00
Diego Biurrun 7df9e693a3 cosmetics: Fix ATRAC codec name spelling 2013-09-02 21:38:57 +02:00
Luca Barbato 2219e27b5b oma: correctly mark and decrypt partial packets
Incomplete crypted files would lead to a read after buffer boundary
otherwise.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-28 22:54:55 +02:00
Luca Barbato 9d0b45ade8 oma: check geob tag boundary
Prevent read after buffer boundary on corrupted tag.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-28 22:54:55 +02:00
Luca Barbato 4f03a77e52 oma: refactor seek function
Properly propagate seek errors from avio and the generic pcm seek.
2013-07-28 22:54:55 +02:00
Luca Barbato db9aee6ccf oma: properly forward errors in oma_read_packet
Prevent spurios EIO on EOF.

CC:libav-stable@libav.org
2013-05-07 14:37:32 +02:00
Luca Barbato 6f98508e2b oma: return meaningful errors 2013-05-07 14:37:32 +02:00
Diego Biurrun e0f8be6413 avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriate 2013-05-04 21:43:06 +02:00
Luca Barbato c140105410 oma: K&R formatting cosmetics 2013-04-27 10:53:24 +02:00
Luca Barbato 0933fd1533 oma: Validate sample rates
The sample rate index is 3 bits even if currently index 5, 6 and 7 are
not supported.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-03-31 16:10:52 +02:00
Diego Biurrun 1ecdf8912b avformat: av_log_ask_for_sample() ---> avpriv_request_sample() 2013-03-13 20:42:21 +01:00
Justin Ruggles bfe5454cd2 lavf: move ff_codec_get_tag() and ff_codec_get_id() definitions to internal.h 2012-11-28 11:18:49 -05:00
Justin Ruggles c9759eb426 omadec: set channel layout 2012-11-12 10:33:21 -05:00
Michael Niedermayer 72ec043af4 oma: Fix out of array read.
Input: 01-Untitled-partial.oma
ZZUF params: zzuf[s=7157,r=0.001]

Fixes Bugzilla #106

Bug-found-by: darkshikari
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-03-18 15:01:58 -07:00
Anton Khirnov 393fd0d89e id3v2: remove unused ff_id3v2_read().
Rename ff_id3v2_read_all to ff_id3v2_read().
2012-02-29 14:19:42 +01:00
Ronald S. Bultje 934cd18a43 oma: don't read beyond end of leaf_table.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-28 11:58:13 -08:00
Martin Storsjö 167f3b8de7 libavformat: Add an ff_ prefix to some lavf internal symbols
Prefix the functions/tables brktimegm, pcm_read_seek,
dv_offset_reset, voc_get_packet, codec_movaudio_tags,
codec_movvideo_tags.

After this, lavf has no global symbols without the proper prefix.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-15 22:06:17 +02:00
Alex Converse 7181c4edee cosmetics: Remove extra newlines at EOF 2012-01-27 17:19:09 -08:00
Anton Khirnov 6e9651d106 lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Anton Khirnov ee20b332c8 omadec: split data that will be used in the muxer to a separate file. 2011-12-18 16:17:39 +01:00
Anton Khirnov 08f7af0c37 lavf: rename oma.c -> omadec.c 2011-12-18 16:17:39 +01:00