Commit Graph

107 Commits

Author SHA1 Message Date
Carl Eugen Hoyos
4d8875ec23 lavf: Constify the probe function argument.
Reviewed-by: Lauri Kasanen
Reviewed-by: Tomas Härdin
2019-03-21 11:42:17 +01:00
Eduard Sinelnikov
7fcbebbeaf avformat/aiffdec: AIFF fix in case of ANNO
Apple's AIFF protocol clearly states that each chucnk which is odd sized a padding should be added.
In the old version of aiffdec adding of padding was done in `get_meta`. And in case of unknown chunk name it was done in defalut case.
The new version has deleted the padding in default case and added padding adding after the switch.
But the new version didn't removed the padding adding in the `get_meta` function so in some cases padding was added twice which leaded to a bug.

Fixes: sample.aiff

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-11 03:29:25 +01:00
Misty De Meo
bfe397e431 aiff: add explicit goto got_sound
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-06 03:15:18 +01:00
Misty De Meo
fde057dfb2 aiff: add support for XA ADPCM
Certain AIFF files encode XA ADPCM compressed audio using a chunk
with the tag `APCM`. Aside from this custom chunk type, they're
otherwise standard AIFF files. I've only observed these files in the
Sega Saturn game Sonic Jam so far.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-04 21:39:34 +01:00
Lukas Stabe
1fd80106be avformat: fix id3 chapters
These changes store id3 chapter data in ID3v2ExtraMeta and introduce
ff_id3v2_parse_chapters to parse them into the format context if needed.

Encoders using ff_id3v2_read, which previously parsed chapters into the
format context automatically, were adjusted to call
ff_id3v2_parse_chapters.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
2017-10-05 17:10:23 +02:00
Clément Bœsch
cd4d6cba12 lavf: fix usages of av_get_codec_tag_string() 2017-03-29 14:49:29 +02:00
James Almer
4de591e6fb Merge commit '83548fe894cdb455cc127f754d09905b6d23c173'
* commit '83548fe894cdb455cc127f754d09905b6d23c173':
  lavf: fix usage of AVIOContext.seekable

Merged-by: James Almer <jamrial@gmail.com>
2017-03-21 17:02:30 -03:00
Matthieu Bouron
e2adbcbd97 Merge commit '0638b99cdba52554691fc668d9e477bc184c7a33'
* commit '0638b99cdba52554691fc668d9e477bc184c7a33':
aiff: Skip padding byte for odd-sized chunks

Also removes to odd-size checks from get_aiff_header and get_meta to use
the generic path introduced by the original commit.

Merged-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2017-03-17 13:31:03 +01:00
Andreas Cadhalpun
ad5807f8aa avformat: fix overflows during bit rate calculation
The bit_rate field has type int64_t since commit
7404f3bdb9.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-12-14 01:06:55 +01:00
Andreas Cadhalpun
93c39db5f1 aiff: check block_align in aiff_read_packet
It can be unset in avcodec_parameters_from_context and a value of 0
causes SIGFPE crashes.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-21 19:40:59 +02:00
Andreas Cadhalpun
c143a9c96f aiffdec: fix division by zero
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-17 18:24:48 +02:00
Carl Eugen Hoyos
4147d8efe5 lavf/aiffdec: Default to full rate qcelp as QT does.
Fixes decoding of the output file from ticket #4009.
2016-10-11 09:49:35 +02:00
Anton Khirnov
83548fe894 lavf: fix usage of AVIOContext.seekable
It is supposed to be a flag. The only currently defined value is
AVIO_SEEKABLE_NORMAL, but other ones may be added in the future.
However all the current lavf code treats this field as a bool (mainly
for historical reasons).
Change all those cases to properly check for AVIO_SEEKABLE_NORMAL.
2016-09-30 16:54:33 +02:00
Diego Biurrun
0638b99cdb aiff: Skip padding byte for odd-sized chunks
Bug-Id: 660
2016-08-10 11:58:38 +02:00
Carl Eugen Hoyos
d5edb6c048 lavf/aiffdec: Support QDMC demuxing. 2016-07-03 04:37:48 +02:00
Paul B Mahol
323b8c95e4 avformat: add AVFormatContext to ff_get_extradata()
Needed for av_log() inside that function.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-04-14 18:21:08 +02:00
Derek Buitenhuis
6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
  lavf: replace AVStream.codec with AVStream.codecpar

This has been a HUGE effort from:
    - Derek Buitenhuis <derek.buitenhuis@gmail.com>
    - Hendrik Leppkes <h.leppkes@gmail.com>
    - wm4 <nfxjfg@googlemail.com>
    - Clément Bœsch <clement@stupeflix.com>
    - James Almer <jamrial@gmail.com>
    - Michael Niedermayer <michael@niedermayer.cc>
    - Rostislav Pehlivanov <atomnuker@gmail.com>

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-10 20:59:55 +01:00
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
Carl Eugen Hoyos
73b0324913 aiff: Support demuxing G.722 streams 2015-11-12 04:39:14 +01:00
Paul B Mahol
a66243a201 avformat/aiff: add ADP4 DVI ADPCM support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-10-27 13:41:54 +01:00
Paul B Mahol
035ae3c009 avcodec: add SDX2 DPCM decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-10-26 10:08:01 +01:00
Paul B Mahol
f7751a5e53 avformat/aiffdec: give friendly message if compressed codec tag is unsupported
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-10-25 14:07:03 +01: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
Michael Niedermayer
70af8a5efb avformat/aiffdec: avoid double and ldexp()
There is no support for non integer sample rates, using doubles/floats currently could
only lead to rounding differences between platforms

Previous version Reviewed-by: Mark Harris <mark.hsj@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-11 13:09:46 +02:00
Michael Niedermayer
c5c09501f9 avformat/aiffdec: do not fail if header parser hits EOF
Based on patch by Martin Vignali <martin.vignali@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-19 01:44:14 +01:00
Michael Niedermayer
ae81e8a9c5 avformat/aiffdec: Stop header parsing once a non header packet is reached
Fix Ticket3530

Based-on debuging work by Martin Vignali <martin.vignali@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-19 01:39:47 +01:00
Michael Niedermayer
a0fe1a25fa Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'
* commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e':
  avformat: Don't anonymously typedef structs

Conflicts:
	libavformat/adtsenc.c
	libavformat/aiffenc.c
	libavformat/avidec.c
	libavformat/gif.c
	libavformat/iff.c
	libavformat/img2dec.c
	libavformat/jvdec.c
	libavformat/matroskadec.c
	libavformat/udp.c
	libavformat/wtvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-14 21:07:40 +01:00
Diego Biurrun
daf8cf358a avformat: Don't anonymously typedef structs 2015-02-14 10:13:47 -08:00
Peter Ross
6243845036 avformat/aiffdec: improve readability
Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 00:50:45 +01:00
Peter Ross
f1098eb97d avformat/aiffdec: only read codec tag when there is space in header
Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-05 01:45:49 +01:00
James Almer
d34ec64a22 replace calls to url_feof() with avio_feof()
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 00:48:38 +02:00
Carl Eugen Hoyos
763e714442 Do not limit blocksize when reading PCM from aiff.
Fixes ticket #3695.
2014-06-03 03:07:55 +02:00
Peter Ross
5331773cc3 ff_id3v2_read: add option to limit ID3 magic number search
Several chunked formats (AIFF, IFF,DSF) store ID3 metadata within an 'ID3 '
chunk tag. If such chunks are stored sequentially, it is possible for the
ID3v2 parser to confuse the chunk tag for the ID3 magic number. e.g.

[1st chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...]
[2nd chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...]

Fixes ticket #3530.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-19 04:25:01 +02:00
Michael Niedermayer
b59740eae5 avformat/aiffdec: use ff_get_extradata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-25 17:14:32 +01:00
Carl Eugen Hoyos
9860fb445a Fix decoding of G.726 in AIFF.
Fixes ticket #1973.
2013-10-18 19:53:47 +02:00
Paul B Mahol
a807c68253 avformat: use ff_alloc_extradata()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-10-13 20:13:38 +00:00
Carl Eugen Hoyos
c153ea4756 Support decoding G.722 in aiff. 2013-06-09 01:10:36 +02:00
Carl Eugen Hoyos
9526c9ccc3 Read block_align from extradata when decoding qclp in aiff.
Fixes ticket #1287.
2013-04-23 16:19:26 +02:00
Carl Eugen Hoyos
db2d3a9082 Skip padding in an id3 tag in aiff files.
Fixes ticket #2430.

Reviewed-by: Matthieu Bouron
2013-04-03 15:45:46 +02:00
Piotr Bandurski
fde13052fb aiffdec: set block duration for QDM2
Fixes #1697.
2013-01-01 17:03:22 +00:00
Matthieu Bouron
cfb1c3c9f0 aiffdec: read ID3 attached pictures
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-26 01:52:40 +02:00
Matthieu Bouron
c68a8a1340 lavf/aiffdec: don't stop parsing after SSND chunk
Some file has ID3 chunk placed after SSND.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-22 19:38:27 +02:00
Clément Bœsch
c4dba58f47 isom: fix redundant redeclaration of ff_mov_read_chan().
Silence a GCC warning. A leftover of the disabled version is still
available in lavf/isom.c.
2012-10-02 00:26:15 +02:00
Michael Niedermayer
fa85118510 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mov_chan: Pass a separate AVIOContext for reading
  af_asyncts: check return value from lavr when flushing.
  mss2: simplify loop in decode_rle()
  mss12: avoid unnecessary division in arith*_get_bit()
  mss2: do not try to read too many palette entries
  mpegvideo: set AVFrame fields to NULL after freeing the base memory
  configure: Set the right cc_e flags for msvc

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-07 13:50:24 +02:00
Michael Niedermayer
e367d90664 aiffdec: support QDM2
Fixes ticket204

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-28 03:18:21 +02:00
Michael Niedermayer
99f5090714 aiffdec: try #2 to fix bps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-27 16:50:59 +02:00
Michael Niedermayer
b9b97c2fb9 aiffdec: fix bits per sample
Fixes Ticket1660

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-27 02:54:00 +02:00
Michael Niedermayer
7a72695c05 Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85':
  Replace all CODEC_ID_* with AV_CODEC_ID_*
  lavc: add AV prefix to codec ids.

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	ffprobe.c
	ffserver.c
	libavcodec/8svx.c
	libavcodec/avcodec.h
	libavcodec/dnxhd_parser.c
	libavcodec/dvdsubdec.c
	libavcodec/error_resilience.c
	libavcodec/h263dec.c
	libavcodec/libvorbisenc.c
	libavcodec/mjpeg_parser.c
	libavcodec/mjpegenc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pcm.c
	libavcodec/r210dec.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/version.h
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavformat/asfdec.c
	libavformat/asfenc.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/caf.c
	libavformat/electronicarts.c
	libavformat/flacdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/framecrcenc.c
	libavformat/img2.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/matroska.c
	libavformat/matroskadec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/movenc.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegts.c
	libavformat/mxf.c
	libavformat/mxfdec.c
	libavformat/mxfenc.c
	libavformat/nsvdec.c
	libavformat/nut.c
	libavformat/oggenc.c
	libavformat/pmpdec.c
	libavformat/rawdec.c
	libavformat/rawenc.c
	libavformat/riff.c
	libavformat/sdp.c
	libavformat/utils.c
	libavformat/vocenc.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 22:45:46 +02:00
Anton Khirnov
36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Michael Niedermayer
e4c00aca96 Merge remote-tracking branch 'qatar/master'
* qatar/master: (38 commits)
  alac: cosmetics: general pretty-printing and comment clean up
  alac: calculate buffer size outside the loop in allocate_buffers()
  alac: change some data types to plain int
  alac: cosmetics: rename some variables and function names
  alac: multi-channel decoding support
  alac: split element parsing into a separate function
  alac: support a read sample size of up to 32
  alac: output in planar sample format
  alac: add 32-bit decoding support
  alac: simplify channel interleaving
  alac: use AVPacket fields directly in alac_decode_frame()
  alac: fix check for valid max_samples_per_frame
  alac: use get_sbits() to read LPC coefficients instead of casting
  alac: move the current samples per frame to the ALACContext
  alac: avoid using a double-negative when checking if the frame is compressed
  alac: factor out output_size check in predictor_decompress_fir_adapt()
  alac: factor out loading of next decoded sample in LPC prediction
  alac: use index into buffer_out instead of incrementing the pointer
  alac: simplify lpc coefficient adaptation
  alac: reduce the number of local variables needed in lpc prediction
  ...

Conflicts:
	libavcodec/alac.c
	libavformat/cafdec.c
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-19 23:31:04 +02:00