Commit Graph

8754 Commits

Author SHA1 Message Date
Janne Grunau 6746cd7f61 lavf probe: prevent codec probe with no data at all seen
This occurs with fuzzed mpeg-ts files. set_codec_from_probe_data() is
called with a zeroed AVProbeData since no packet made through for
specific stream.
2012-09-20 14:50:06 +02:00
Anton Khirnov 50d1f4437b mp3dec: read Xing frame TOC index 2012-09-19 20:59:45 +02:00
Anton Khirnov 2d1a1a7f62 mp3dec: use named constants for Xing header flags 2012-09-19 20:59:44 +02:00
Yusuke Nakamura d17d0ec8c2 mov: support random access point grouping
Frames described by this grouping are the starter of a closed or
an open GOP.
This is useful for open GOP of H.264 stream which is not described
by sync sample atom.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-19 20:34:15 +02:00
Luca Barbato 7d8431004a matroskadec: properly support BlockDuration 2012-09-19 20:34:14 +02:00
Luca Barbato c831ebf616 matroskadec: split frame parsing 2012-09-19 20:34:14 +02:00
Luca Barbato 2d0e7713f9 matroskadec: split laces parsing 2012-09-19 20:34:14 +02:00
Luca Barbato 117d8c6d1f matroska: implement support for ProRes
Support Matroska native formatting.

On demuxing prepend a Frame container atom (32bit big endian encoded
frame size and 'icpf' string).
On muxing remove it.
2012-09-19 20:34:14 +02:00
Moritz Bunkus 8071dca3d5 matroska: implement support for ALAC
Support Matroska native formatting.

On demuxing reconstruct the 36-bytes QuickTime atom that the ALAC
decoder expects by prepending the "atom size", "tag" and
"tag version" fields missing from the Matroska's CodecPrivate
element.

On muxing remove the initial 12 bytes

Sample files are available:
http://www.bunkus.org/videotools/mkvtoolnix/samples/alac/alac-in-matroska.mka
and the CoreAudio file it was created from with today's mkvmerge:
http://www.bunkus.org/videotools/mkvtoolnix/samples/alac/alac-in-matroska-source.caf

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-19 20:34:14 +02:00
Luca Barbato 870e75524a matroskadec: validate lace_size when parsed
Stricter validation, explicitly exit on misparsing and some error
forwarding from the ebml parsing functions used.
2012-09-19 20:34:14 +02:00
Luca Barbato c9a39cec70 matroskadec: return meaningful errors in matroska_decode_buffer 2012-09-19 20:34:14 +02:00
Dale Curtis df1d84121b matroskadec: fix incorrect unsigned->signed conversion 2012-09-19 20:34:14 +02:00
Luca Barbato 8d4dd55c37 matroskadec: refactor matroska_decode_buffer
Make MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP behave like
the other encodings and spare few lines of boilerplate code.
2012-09-19 20:34:14 +02:00
Luca Barbato 581281e242 matroskadec: check realloc in lzo encoding
Make all the compression encodings behave the same way.
2012-09-19 20:34:13 +02:00
Luca Barbato cd4739c4f2 matroska: honor error_recognition on unknown doctypes 2012-09-19 20:34:13 +02:00
Martin Storsjö 84cc314e40 smoothstreaming: Export the mp4 codec tags
This fixes stream copy from a format that already has incompatible
codec tags set. The chained ismv muxer exports this same codec tag
list, so set it on this one as well, to allow the caller (and
lavf common code) to set them correctly.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-18 17:59:57 +03:00
Luca Barbato 9888ffb1ce mov: check for EOF in long lasting loops
A quite widespread pattern in the demuxer is read a 32bit unsigned
integer and then loop till this value is reached.

Checking for EOF prevents pathological situations.
2012-09-18 15:32:52 +02:00
Benjamin Larsson 6a08955c10 flvenc: silence bogus warning
The compiler fails to figure out that enc->codec_type can only
have 3 different values.
Thus when an if/else is encountered it triggers on the possibility
of the else case has not initialized the flags variable.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-18 10:31:04 +02:00
Clément Bœsch 049ce4facb id3v2: strdup the genre name explicitly.
It would have been done anyway in the av_dict_set() call.

This simplifies the code and avoid a warning because of assigning a
const string from ff_id3v1_genre_str to a non-const variable.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-17 15:48:20 +02:00
Clément Bœsch ffdd2e9144 lavf/id3v2: do not export empty fields.
This also avoids a memleak.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-17 15:48:20 +02:00
Michael Niedermayer a5ea623b36 mov: stsd entries must be at least 16 byte
Fix near infinite loop in stsd parsing.
Bug found by: Diana Elena Muscalu

The size is unsigned according the specification.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-16 16:53:06 +02:00
Michael Niedermayer 9db67bedf0 mov: detect EOF in mov_read_dref()
Avoid a near infinite loop.
Issue discovered by cosminamironesei.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-16 16:31:03 +02:00
Luca Barbato 4ed5ac50d3 file: return proper error on seek failures 2012-09-16 15:37:14 +02:00
Luca Barbato 3f7fd59d15 avformat: fix typo in avformat_close_input
The condition should not be &&.
2012-09-15 20:23:39 +02:00
Anton Khirnov 7040c9fac2 mp3enc: write Xing TOC
Based on the code by:
Peter Belkner <pbelkner@snafu.de>,
Michael Niedermayer <michaelni@gmx.at>,
Clément Bœsch <clement.boesch@smartjog.com>,
Reimar Döffinger <Reimar.Doeffinger@gmx.de>, and
Tobias Rapp <t.rapp@noa-audio.com>
Alex Converse <alex.converse@gmail.com>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-15 18:25:34 +02:00
Clément Bœsch ca8e39dd0d mp3enc: support MPEG-2 and MPEG-2.5 in Xing header. 2012-09-15 18:25:22 +02:00
Reimar Döffinger 6365e4db79 mp3enc: downgrade some errors in writing Xing frame to warnings
Also clarify the meaning of the log message.
2012-09-15 18:25:15 +02:00
Anton Khirnov 3b4bb19e63 lavf: flush the output AVIOContext in av_write_trailer().
This is consistent with stdio and is what we want to do in all cases.

Fixes a bug in the voc muxer which didn't flush in write_trailer()
previously. This is the cause of the change in the test results.
2012-09-15 18:25:07 +02:00
Anton Khirnov 0c270239c2 lavf: cosmetics, reformat av_write_trailer(). 2012-09-15 18:24:59 +02:00
Stefano Sabatini 5d1203f063 avio: flush the internal buffer in avio_close()
This is consistent with stdio, and thus what people would naturally
expect.
2012-09-15 18:24:49 +02:00
Derek Buitenhuis 1c56cdad33 riff: Add SVQ3 fourcc
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-09-14 14:12:52 -04:00
Luca Barbato 44272c1ccc avformat: refactor avformat_close_input
Do not crash if the input format is not allocated yet.
2012-09-14 14:26:27 +02:00
Luca Barbato 4d1f443c3d avformat: simplify avformat_close_input
avio_close checks by itself for NULL condition.
2012-09-14 14:26:27 +02:00
Martin Storsjö ca6b544ac9 os_support: Choose between direct.h and io.h using a configure check
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-13 14:56:54 +03:00
Martin Storsjö 7b07fab567 os_support: Include io.h instead of direct.h on mingw32ce
Windows CE doesn't have neither mkdir nor _mkdir officially (only
CreateDirectoryW), but mingw32ce has compat wrappers with these names
(declared in io.h since direct.h is unavailable).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-13 13:52:50 +03:00
Christian Schmidt 07584eaf4a mpegts: check substreams before discarding
Allow to extract the AC3 core from TrueHD with the "copy" codec.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-12 23:43:53 +02:00
Martin Storsjö 62c9ae11a7 Add a smooth streaming segmenter muxer
This muxer splits the output from the ismv muxer into individual
files, in realtime.

The same can also be done by the standalone tool ismindex, but this
muxer is needed for doing it in realtime (especially for live
streams that need extra handling for updating the lookahead fields
in the fragment headers).

Using this muxer, one can deliver live smooth streaming from a
normal static file web server. (Using ismindex, one can deliver
premade smooth streaming files from a static file web server,
or prepare files for serving with IIS.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 23:42:16 +03:00
Martin Storsjö 29a9b12b10 file: Add an avoption for disabling truncating existing files on open
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 23:42:09 +03:00
Tomas Härdin 5e3572893d img2dec: always close AVIOContexts
Zero sized files would cause the contexts to leak away.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-12 14:31:09 +02:00
Martin Storsjö c3bcd22ed3 rtpdec_jpeg: Error out on other unsupported type values as well
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:10:56 +03:00
Martin Storsjö 1743938df1 rtpdec_jpeg: Disallow using the reserved q values
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:10:45 +03:00
Martin Storsjö 1de9317bd0 rtpdec_jpeg: Fold the default qtables case into an existing if statement
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:10:32 +03:00
Martin Storsjö a218deb856 rtpdec_jpeg: Store and reuse old qtables for q values 128-254
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:10:05 +03:00
Martin Storsjö a252649059 rtpdec_jpeg: Simplify the calculation of the number of qtables
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:09:57 +03:00
Martin Storsjö cbaa9eeda3 rtpdec_jpeg: Add more comments about the fields in the SOF0 section
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:09:30 +03:00
Martin Storsjö 31adff08a1 rtpdec_jpeg: Clarify where the subsampling magic numbers come from
Write out the numbers the way they are constructed, not just the
final values.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:09:21 +03:00
Martin Storsjö c64d2a63df rtpdec_jpeg: Don't use a bitstream writer for the EOI marker
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:09:02 +03:00
Martin Storsjö 20f325f320 rtpdec_jpeg: Don't needlessly use a bitstream writer for the header
Everything written with this bitstream writer is 8/16 bit units
(except for a pair of 4 bit values), so using a bitstream writer
isn't necessary.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:08:33 +03:00
Martin Storsjö 43957fcc71 rtpdec_jpeg: Simplify writing of the jpeg header
Generalize writing of any number of qtables. Don't manually write
16 bit values in two separate calls.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:08:09 +03:00
Martin Storsjö 932d8300d3 rtpdec_jpeg: Merge two if statements
This makes the code more readable and robust.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:07:57 +03:00