ffmpeg.git
4 years agoformats: Check memory allocations
Vittorio Giovara [Thu, 12 Mar 2015 15:34:32 +0000 (15:34 +0000)]
formats: Check memory allocations

4 years agonutdec: Prevent leaks on memory error
Vittorio Giovara [Wed, 11 Mar 2015 19:24:59 +0000 (19:24 +0000)]
nutdec: Prevent leaks on memory error

Bug-Id: CID 205122 / CID 205123

4 years agoxcbgrab: Check av_strdup() allocation
Vittorio Giovara [Wed, 11 Mar 2015 19:25:01 +0000 (19:25 +0000)]
xcbgrab: Check av_strdup() allocation

Bug-Id: CID 1274038

4 years agolibtheora: Check frame allocation
Vittorio Giovara [Thu, 12 Mar 2015 12:34:52 +0000 (12:34 +0000)]
libtheora: Check frame allocation

4 years agompegvideo_enc: Check AVCodecContext allocation
Vittorio Giovara [Wed, 11 Mar 2015 19:46:29 +0000 (19:46 +0000)]
mpegvideo_enc: Check AVCodecContext allocation

4 years agodca: Document the permuted order in the lfe_fir_64 and lfe_fir_128 tables
Niels Möller [Thu, 12 Mar 2015 12:26:40 +0000 (13:26 +0100)]
dca: Document the permuted order in the lfe_fir_64 and lfe_fir_128 tables

4 years agolavf: Explicitly convert types at function pointer assignment
Diego Biurrun [Tue, 10 Feb 2015 15:02:30 +0000 (16:02 +0100)]
lavf: Explicitly convert types at function pointer assignment

This fixes a number of "assignment from incompatible pointer type" warnings.

4 years agoconfigure: Mark qsv subsystem as not selectable on the command line
Diego Biurrun [Wed, 11 Mar 2015 09:39:26 +0000 (10:39 +0100)]
configure: Mark qsv subsystem as not selectable on the command line

4 years agoroqvideoenc: set enc->avctx in roq_encode_init
Andreas Cadhalpun [Mon, 9 Mar 2015 18:24:09 +0000 (19:24 +0100)]
roqvideoenc: set enc->avctx in roq_encode_init

So far it is only set in roq_encode_frame, but it is used in
roq_encode_end to free the coded_frame. This currently segfaults if
roq_encode_frame is not called between roq_encode_init and
roq_encode_end.

CC:libav-stable@libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agoasfenc: fix leaking asf->index_ptr on error
Andreas Cadhalpun [Mon, 9 Mar 2015 18:31:39 +0000 (19:31 +0100)]
asfenc: fix leaking asf->index_ptr on error

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agoqsv: Improve the log message of when initializing MFX_IMPL_HARDWARE{2, 3, 4}
Yukinori Yamazoe [Wed, 11 Mar 2015 09:04:30 +0000 (18:04 +0900)]
qsv: Improve the log message of when initializing MFX_IMPL_HARDWARE{2, 3, 4}

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agoconfigure: Enable colored output for gcc 4.9+
Vittorio Giovara [Mon, 9 Mar 2015 01:02:01 +0000 (01:02 +0000)]
configure: Enable colored output for gcc 4.9+

4 years agortpdec_vp9: Drop extra sanity check for size of input packet
Vittorio Giovara [Mon, 9 Mar 2015 17:27:22 +0000 (17:27 +0000)]
rtpdec_vp9: Drop extra sanity check for size of input packet

In this case len is always at least 1, since it is checked against
RTP_VP9_DESC_REQUIRED_SIZE + 1 and then it is reduced by
RTP_VP9_DESC_REQUIRED_SIZE before entering the has_pic_id check.

Bug-Id: CID 1270811

4 years agomp3: Properly use AVCodecContext API
Vittorio Giovara [Mon, 9 Mar 2015 23:02:00 +0000 (23:02 +0000)]
mp3: Properly use AVCodecContext API

Rather than having an unitialized context on the stack, allocate it with
defaults and free it when unneeded.

CC: libav-stable@libav.org
4 years agomatroskaenc: Fix type used for chapter timestamps
Vittorio Giovara [Wed, 11 Mar 2015 14:56:52 +0000 (14:56 +0000)]
matroskaenc: Fix type used for chapter timestamps

4 years agomlpdec: support TrueHD streams with an Atmos substream
Hendrik Leppkes [Fri, 26 Sep 2014 11:49:21 +0000 (13:49 +0200)]
mlpdec: support TrueHD streams with an Atmos substream

The fourth substream is being discarded, since its not raw audio data,
but an encoded Atmos stream which needs a specialized decoder.

Fixes decoding of the true hd stream from Transformers\ -\ Age\ of\ Extinction\ 2014\ 1080P-003.mkv

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agomlpdec: support major sync headers with optional extension blocks
Hendrik Leppkes [Fri, 26 Sep 2014 11:49:20 +0000 (13:49 +0200)]
mlpdec: support major sync headers with optional extension blocks

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agomovenc: Support setting fragment_index before the moov atom is written
Martin Storsjö [Tue, 20 Jan 2015 14:33:12 +0000 (15:33 +0100)]
movenc: Support setting fragment_index before the moov atom is written

This way, the caller doesn't need to coordinate setting the option
after the moov atom has been written. The downside is that it is
no longer possible to use the option for checking whether the moov
atom already has been written, but a caller is able to keep track
of that by other means anyway.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Don't rely on the fragment index for vc1 info gathering
Martin Storsjö [Tue, 20 Jan 2015 14:54:03 +0000 (15:54 +0100)]
movenc: Don't rely on the fragment index for vc1 info gathering

The previous use of the mov->fragments field, for determining whether
written packets were part of the first fragment or not, didn't
work as intended when using the empty_moov flag.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc_mpegts: Set chain->rtp_ctx only after avformat_write_header succeeded
Martin Storsjö [Mon, 9 Mar 2015 21:14:19 +0000 (23:14 +0200)]
rtpenc_mpegts: Set chain->rtp_ctx only after avformat_write_header succeeded

By making sure we at each time only have one pointer set, either a
local variable or one in the context, we avoid potential double frees
in the cleanup routines. If chain->rtp_ctx is set, it is closed by
calling avformat_write_trailer, but that shouldn't be called unless
avformat_write_header succeeded.

This issue was pointed out by Andreas Cadhalpun.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc_mpegts: Free the right ->pb in the error path in the init function
Martin Storsjö [Mon, 9 Mar 2015 21:09:10 +0000 (23:09 +0200)]
rtpenc_mpegts: Free the right ->pb in the error path in the init function

This fixes a typo from 8e32b1f096.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoFATE: add support for testing hwaccels
Anton Khirnov [Mon, 9 Mar 2015 09:56:54 +0000 (10:56 +0100)]
FATE: add support for testing hwaccels

4 years agoavconv: do not abort immediately if initializing hwaccel fails
Anton Khirnov [Mon, 9 Mar 2015 09:54:00 +0000 (10:54 +0100)]
avconv: do not abort immediately if initializing hwaccel fails

exit_program() will try to free the decoders, which is not a good idea
from within get_format().
Return an error instead.

4 years agolibvpx: Fix mixed use of av_malloc() and av_reallocp()
Vittorio Giovara [Sun, 8 Mar 2015 21:08:16 +0000 (21:08 +0000)]
libvpx: Fix mixed use of av_malloc() and av_reallocp()

This buffer is resized when vpx_codec_get_cx_data() returns a
VPX_CODEC_STATS_PKT packet.

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agosiff: Use the correct type for packet size variables
Vittorio Giovara [Sun, 8 Mar 2015 23:59:58 +0000 (23:59 +0000)]
siff: Use the correct type for packet size variables

The avio functions used here return an unsigned value.
Also reduce a variable scope.

CC: libav-stable@libav.org
Bug-Id: CID 1258461

4 years agomatroskaenc: Also validate chapter end time
Vittorio Giovara [Mon, 9 Mar 2015 00:05:30 +0000 (00:05 +0000)]
matroskaenc: Also validate chapter end time

This prevents it to be written as unsigned. Also add an error message.

CC: libav-stable@libav.org
Bug-Id: CID 1265717

4 years agortpdec_hevc: Drop extra sanity check for size of input packet
Vittorio Giovara [Sun, 8 Mar 2015 23:42:59 +0000 (23:42 +0000)]
rtpdec_hevc: Drop extra sanity check for size of input packet

In this case len is always at least 3, since it is checked against
RTP_HEVC_PAYLOAD_HEADER_SIZE + 1 before entering the switch block.

Bug-Id: CID 1238784

4 years agomovenc: Avoid writing separate flags for the first sample if not necessary
Martin Storsjö [Fri, 6 Mar 2015 09:26:40 +0000 (11:26 +0200)]
movenc: Avoid writing separate flags for the first sample if not necessary

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Set tfhd default sample flags based on actual samples, if possible
Martin Storsjö [Fri, 6 Mar 2015 09:22:35 +0000 (11:22 +0200)]
movenc: Set tfhd default sample flags based on actual samples, if possible

This avoids assuming that e.g. audio samples are marked as
sync samples.

This allows omitting the sample flags from trun, if the default
flags happen to be right for all the samples.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoutvideodec: Handle slice_height being zero
Michael Niedermayer [Wed, 4 Mar 2015 17:36:14 +0000 (17:36 +0000)]
utvideodec: Handle slice_height being zero

Fixes out of array accesses.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Bug-Id: CVE-2014-9604
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agoavprobe: Export coded_{width,height} in -show_streams
Vittorio Giovara [Sun, 8 Mar 2015 03:25:25 +0000 (03:25 +0000)]
avprobe: Export coded_{width,height} in -show_streams

4 years agotiff: Check that there is no aliasing in pixel format selection
Anton Khirnov [Sat, 7 Mar 2015 21:06:59 +0000 (22:06 +0100)]
tiff: Check that there is no aliasing in pixel format selection

Fixes possible issues with unexpected bpp/bppcount values.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Bug-Id: CVE-2014-8544
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agomxfdec: Fix the error handling for when strftime fails
Martin Storsjö [Sat, 7 Mar 2015 22:19:45 +0000 (00:19 +0200)]
mxfdec: Fix the error handling for when strftime fails

The str variable is a char ** here.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoxcbgrab: Free the host string after checking the connection
Luca Barbato [Thu, 5 Mar 2015 08:44:55 +0000 (09:44 +0100)]
xcbgrab: Free the host string after checking the connection

Prevent an use after free in the error message.

Bug-Id: CID 1274040
CC: libav-stable@libav.org
4 years agovorbis: Check the vlc value in setup_classifs
Luca Barbato [Tue, 3 Mar 2015 10:05:15 +0000 (11:05 +0100)]
vorbis: Check the vlc value in setup_classifs

The valid returned values are always at most 11bit.
Remove the previous check that assumed larger values plausible and
use a signed integer to check get_vlc2 return values.

CC: libav-stable@libav.org
4 years agovorbis: Use a local codebook variable
Luca Barbato [Tue, 3 Mar 2015 09:32:26 +0000 (10:32 +0100)]
vorbis: Use a local codebook variable

Makes the code a little simpler.

4 years agormdec: Improve message for demux error
Carl Eugen Hoyos [Thu, 5 Mar 2015 16:42:45 +0000 (16:42 +0000)]
rmdec: Improve message for demux error

Use correct context, reduce log level, don't assume it is a video stream,
and print the tag of the unknown stream.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agoconfigure: Move the .object_arch check to the right place
Martin Storsjö [Thu, 5 Mar 2015 21:38:00 +0000 (23:38 +0200)]
configure: Move the .object_arch check to the right place

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoarm: Suppress tags about used cpu arch and extensions
Martin Storsjö [Tue, 17 Feb 2015 22:40:06 +0000 (00:40 +0200)]
arm: Suppress tags about used cpu arch and extensions

When all the codepaths using manually set .arch/.fpu code is
behind runtime detection, the elf attributes should be suppressed.

This allows tools to know that the final built binary doesn't
strictly require these extensions.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodoc: Add -list_formats all example for video4linux2
Jonas Lindgren [Fri, 6 Mar 2015 22:02:34 +0000 (23:02 +0100)]
doc: Add -list_formats all example for video4linux2

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agomovenc: Keep writing zero-entry stts atoms as intended
Martin Storsjö [Fri, 6 Mar 2015 10:27:14 +0000 (12:27 +0200)]
movenc: Keep writing zero-entry stts atoms as intended

a876585215 had the unintended side effect of returning AVERROR(ENOMEM)
when track->entry is zero, while the code intentionally wants to
continue in that case.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodashenc: Update extradata for mov muxer
Timo Rothenpieler [Wed, 4 Mar 2015 21:48:43 +0000 (22:48 +0100)]
dashenc: Update extradata for mov muxer

The mov muxer already supports picking up extradata that wasn't
present during the avformat_write_header call - we just need to
propagate it. Since the dash muxer uses delay_moov, we have time
up until the first segment is written to get extradata filled in.

Also update the codec description string when the extradata becomes
available.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodashenc: Simplify code by using a local variable
Timo Rothenpieler [Wed, 4 Mar 2015 21:48:43 +0000 (22:48 +0100)]
dashenc: Simplify code by using a local variable

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolibopenh264enc: Add support for building with OpenH264 1.4
Martin Storsjö [Thu, 5 Mar 2015 11:57:44 +0000 (13:57 +0200)]
libopenh264enc: Add support for building with OpenH264 1.4

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoavfilter: Return more meaningful error codes
Himangi Saraogi [Mon, 23 Feb 2015 04:21:16 +0000 (09:51 +0530)]
avfilter: Return more meaningful error codes

Signed-off-by: Diego Biurrun <diego@biurrun.de>
4 years agoh264: remove a now redundant error check
Anton Khirnov [Tue, 27 Jan 2015 11:31:24 +0000 (12:31 +0100)]
h264: remove a now redundant error check

It was only relevant when data partitioning was in use.

4 years agoavformat/adxdec: set avctx->channels in adx_read_header
Andreas Cadhalpun [Thu, 26 Feb 2015 00:06:57 +0000 (01:06 +0100)]
avformat/adxdec: set avctx->channels in adx_read_header

It is used in adx_read_packet, which currently depends on the
decoder/parser setting this value between reading the file header and
demuxing the first packet.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agormenc: limit packet size
Andreas Cadhalpun [Mon, 2 Mar 2015 15:52:26 +0000 (16:52 +0100)]
rmenc: limit packet size

The chunk size is limited to UINT16_MAX (written by avio_wb16), so make
sure that the packet size is not too large.

Such large frames need to be split into slices smaller than 64 kB, but
that is currently supported neither by the rv10/rv20 encoders nor the rm
muxer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agowebp: validate the distance prefix code
Andreas Cadhalpun [Mon, 2 Mar 2015 19:47:57 +0000 (20:47 +0100)]
webp: validate the distance prefix code

According to the WebP Lossless Bitstream Specification the highest
allowed value for a prefix code is 39.

If prefix_code is too large, the calculated extra_bits has an invalid
value and triggers an assertion in get_bits.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agorv10: check size of s->mb_width * s->mb_height
Andreas Cadhalpun [Tue, 3 Mar 2015 20:31:15 +0000 (21:31 +0100)]
rv10: check size of s->mb_width * s->mb_height

If it doesn't fit into 12 bits it triggers an assertion.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agortpdec: experimental VP9 depacketizer (draft 0)
Thomas Volkert [Tue, 3 Mar 2015 23:33:31 +0000 (00:33 +0100)]
rtpdec: experimental VP9 depacketizer (draft 0)

The code was tested with live555 server.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agopcxenc: Return more meaningful error codes
Himangi Saraogi [Wed, 4 Mar 2015 15:44:04 +0000 (21:14 +0530)]
pcxenc: Return more meaningful error codes

Signed-off-by: Diego Biurrun <diego@biurrun.de>
4 years agordt: Use a separate variable to clarify the different value namespaces
Martin Storsjö [Wed, 4 Mar 2015 08:00:08 +0000 (10:00 +0200)]
rdt: Use a separate variable to clarify the different value namespaces

The original flags variable contains rtpdec flags, while the
rmflags variable contains RM flag bits which have a completely
different definition.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpdec_qt: Use a local variable instead of RTP_FLAG_KEY
Martin Storsjö [Wed, 4 Mar 2015 07:57:02 +0000 (09:57 +0200)]
rtpdec_qt: Use a local variable instead of RTP_FLAG_KEY

The only case where RTP_FLAG_KEY actually is needed is
in RDT, where such a flag needs to be passed via the
rtpdec parse function's flags parameter.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpdec_asf: Don't set RTP_FLAG_KEY
Martin Storsjö [Wed, 4 Mar 2015 07:52:33 +0000 (09:52 +0200)]
rtpdec_asf: Don't set RTP_FLAG_KEY

Nothing in the framework nor in the rest of the depacketizer actually
uses this flag - the chained demuxer sets the keyframe flag properly on
demuxed packets already.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoflv: Validate and reject unsupported codecs
Luca Barbato [Tue, 3 Mar 2015 13:39:26 +0000 (14:39 +0100)]
flv: Validate and reject unsupported codecs

And provide a more informative message in case of failure.

CC: libav-stable@libav.org
4 years agoaac: Relax reserved_bit validation
Vittorio Giovara [Tue, 3 Mar 2015 19:38:32 +0000 (19:38 +0000)]
aac: Relax reserved_bit validation

Although the specification mandates this bit to zero, it may happen
that software tools incorrectly flip it to one, invalidating a possibly
valid stream.

Relax this restriction, by failing only when AV_EF_BITSTREAM is set.
This behaviour is similar to aac decoders in Firefox and Quicktime.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agodca: Move syncword definitions to a separate header
Diego Biurrun [Wed, 25 Feb 2015 12:50:15 +0000 (13:50 +0100)]
dca: Move syncword definitions to a separate header

4 years agortpdec_asf: Don't free the payload context in the .close function
Martin Storsjö [Wed, 4 Mar 2015 07:50:44 +0000 (09:50 +0200)]
rtpdec_asf: Don't free the payload context in the .close function

This was missed in bb4a310bb. This fixes a double free on close.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agofate: Specify the idct to use for the aic-oddsize test
Martin Storsjö [Wed, 4 Mar 2015 07:31:16 +0000 (09:31 +0200)]
fate: Specify the idct to use for the aic-oddsize test

This fixes fate on all architectures that have an optimized
but not bitexact idct available.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpdec_mpa_robust: Fix incrementing split_pos
Martin Storsjö [Mon, 2 Mar 2015 12:46:30 +0000 (14:46 +0200)]
rtpdec_mpa_robust: Fix incrementing split_pos

This fixes an oversight in 96084251, in a refactoring done on top
of Gilles' original patch.

Pointed out by Gilles Chanteperdrix.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agowma.h: #include "avcodec.h"
Anton Khirnov [Mon, 2 Mar 2015 20:51:02 +0000 (21:51 +0100)]
wma.h: #include "avcodec.h"

It's required for at least AVCodecContext.

Fixes make checkheaders.

4 years agoasf: do not export XMP metadata by default
Vittorio Giovara [Mon, 2 Mar 2015 18:04:03 +0000 (18:04 +0000)]
asf: do not export XMP metadata by default

Similarly to what has been done for MOV, display XMP metadata only when
users explicitly require it.

The Extensible Metadata Platform tag can contain various kind of data
which are not strictly related to the video file, such as history of
edits and saves from the project file.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agofate: Add AIC test with odd sizes
Vittorio Giovara [Mon, 2 Mar 2015 13:03:39 +0000 (13:03 +0000)]
fate: Add AIC test with odd sizes

4 years agoaic: Fix decoding files with odd dimensions
Vittorio Giovara [Fri, 27 Feb 2015 19:00:25 +0000 (19:00 +0000)]
aic: Fix decoding files with odd dimensions

Normally the aic decoder finds the proper slice combination (multiple of
some number less than 32) but in case of odd width, it resorts to the
default values, which were actually swapped.
The number of slices is modified to account for such odd width cases.

CC: libav-stable@libav.org
4 years agodashenc: Simplify code by using a local variable
Martin Storsjö [Mon, 2 Mar 2015 12:10:22 +0000 (14:10 +0200)]
dashenc: Simplify code by using a local variable

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoRevert "mov: Change DTS-based seek into CTS-based seek."
Martin Storsjö [Sat, 28 Feb 2015 21:51:16 +0000 (23:51 +0200)]
Revert "mov: Change DTS-based seek into CTS-based seek."

This reverts commit 4abfa387b8234736f6e0e541951e3d5eb60eb843.

This commit broke playback of fragmented mp4 files with b-frames.
While investigating this, it turned out that the general framework
isn't ready for a PTS-based index yet. Revert this change until
a better thought out solution is in place.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agov4l2: Add support for h264
Luca Barbato [Fri, 27 Feb 2015 00:34:52 +0000 (01:34 +0100)]
v4l2: Add support for h264

4 years agov4l2: Use the codec descriptor facility
Luca Barbato [Fri, 27 Feb 2015 01:12:33 +0000 (02:12 +0100)]
v4l2: Use the codec descriptor facility

The encoder or decoder might be disabled but the format would be
supported for at least remuxing.

4 years agoprores: Extend the padding check to 16bit
Luca Barbato [Wed, 25 Feb 2015 14:29:15 +0000 (15:29 +0100)]
prores: Extend the padding check to 16bit

Some files produced by the official encoder have up to 16bit of
padding instead of the expected padding to the byte.

Use a self-explanatory macro instead of a simple number.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agortpenc: Don't set max_frames_per_packet based on the packet frame size or frame rate
Martin Storsjö [Wed, 25 Feb 2015 22:00:39 +0000 (00:00 +0200)]
rtpenc: Don't set max_frames_per_packet based on the packet frame size or frame rate

Instead check the timestamps while muxing, to avoid buffering a
too long timestamp range into one single packet.

This makes the AMR and AAC packetization slightly less efficient,
since we set a possibly unnecessarily high max_frames_per_packet.
(These packetizers end up doing a memmove of the TOC bytes if
sending a packet before max_frames_per_packet is achieved, and
we end up setting max_frames_per_packet to a value that should
be high enough for most uses.)

All packetizers that use max_frames_per_packet now set it either
to a default value, or to a value calculated based on other
parameters, so none of them rely on the previous default setting.

For iLBC, copy one frame at a time, to allow checking the timestamp
range for each of them - basically doing potentially multiple
loops to simplify the code instead of trying to calculate the
number of frames to buffer while honoring s1->max_delay.

This is in preparation for reducing the coupling between libavformat
and libavcodec, by not having the muxers use the encoder field
frame_size (which may not be available during e.g. stream copy).

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc: Restructure if statements in packetizers to simplify adding more conditions
Martin Storsjö [Fri, 27 Feb 2015 10:32:42 +0000 (12:32 +0200)]
rtpenc: Restructure if statements in packetizers to simplify adding more conditions

Factorize out the s->num_frames check at the start of the if statements,
simplifying adding more alternative causes for sending the buffered
frames.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc: Skip redundant initialization
Martin Storsjö [Thu, 26 Feb 2015 11:37:56 +0000 (13:37 +0200)]
rtpenc: Skip redundant initialization

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc: Always do the default initialization regardless of codecs
Martin Storsjö [Thu, 26 Feb 2015 11:33:59 +0000 (13:33 +0200)]
rtpenc: Always do the default initialization regardless of codecs

This avoids having to jump to the defaultcase in the switch. Manually
override the stream time base back to 90 kHz for the few audio codecs
that don't use the sample rate as time base (mp2, mp3).

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc_xiph: Don't exclude headers from max_payload_size
Martin Storsjö [Thu, 26 Feb 2015 11:39:17 +0000 (13:39 +0200)]
rtpenc_xiph: Don't exclude headers from max_payload_size

This makes things more consistent by using the variable in the same
way as in all other packetizers.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc_xiph: Use AV_WB16 instead of manual bitshifts
Martin Storsjö [Thu, 26 Feb 2015 11:42:43 +0000 (13:42 +0200)]
rtpenc_xiph: Use AV_WB16 instead of manual bitshifts

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc_aac: Use AV_WB16 instead of manual bitshifts
Martin Storsjö [Wed, 25 Feb 2015 22:25:11 +0000 (00:25 +0200)]
rtpenc_aac: Use AV_WB16 instead of manual bitshifts

This makes the code slightly more readable and understandable.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc_aac: Merge a definition with a declaration
Martin Storsjö [Wed, 25 Feb 2015 22:21:03 +0000 (00:21 +0200)]
rtpenc_aac: Merge a definition with a declaration

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc: Write conditional statements on separate lines
Martin Storsjö [Wed, 25 Feb 2015 21:33:24 +0000 (23:33 +0200)]
rtpenc: Write conditional statements on separate lines

Intentionally keeping some conditional statements on single lines
in rtpenc_h263.c.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc_aac: Set a default value for max_frames_per_packet at init
Martin Storsjö [Wed, 25 Feb 2015 21:34:36 +0000 (23:34 +0200)]
rtpenc_aac: Set a default value for max_frames_per_packet at init

This avoids having to conditionally set the default within the
packetizer function.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc_amr: Use s->num_frames instead of s->buf_ptr - s->buf
Martin Storsjö [Fri, 27 Feb 2015 10:30:54 +0000 (12:30 +0200)]
rtpenc_amr: Use s->num_frames instead of s->buf_ptr - s->buf

This doesn't fix any bug, but makes the code simpler for later
patches, and more straightforward to read as is.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc_aac: Fix sending fragmented frames
Martin Storsjö [Wed, 25 Feb 2015 21:55:58 +0000 (23:55 +0200)]
rtpenc_aac: Fix sending fragmented frames

After sending a fragmented frame, len (s->buf_ptr - s->buf) isn't
zero, while s->num_frames is zero as intended. Using s->num_frames
makes it work as intended, and is less convoluted than keeping track
of (resetting) s->buf_ptr.

This avoids sending stray data after sending a fragmented aac packet.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoAdd a QSV decoding example.
Anton Khirnov [Wed, 11 Feb 2015 23:07:29 +0000 (00:07 +0100)]
Add a QSV decoding example.

4 years agoavcodec/utils: use correct printf specifier in ff_set_sar
Andreas Cadhalpun [Sat, 28 Feb 2015 19:11:36 +0000 (20:11 +0100)]
avcodec/utils: use correct printf specifier in ff_set_sar

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agox11grab: Unbreak building
Christian Hujer [Fri, 27 Feb 2015 09:22:08 +0000 (10:22 +0100)]
x11grab: Unbreak building

The correct macro is DEC not D. Broken in
b31328d008985f87f0a7c83c700847cef1a4f08c

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agolavc: do not compile fmtconvert unconditionally
Anton Khirnov [Sat, 21 Feb 2015 10:24:44 +0000 (11:24 +0100)]
lavc: do not compile fmtconvert unconditionally

Only ac3dec and dcadec use it.

4 years agofmtconvert: drop unused functions
Anton Khirnov [Sat, 21 Feb 2015 10:37:52 +0000 (11:37 +0100)]
fmtconvert: drop unused functions

4 years agolavc: remove unused traces of fmtconvert usage
Anton Khirnov [Sat, 21 Feb 2015 10:00:59 +0000 (11:00 +0100)]
lavc: remove unused traces of fmtconvert usage

Those decoders have been switched to float output and so do not use
fmtconvert anymore.

4 years agotls: Pass AVOptions dictionaries through to the chained protocol
Martin Storsjö [Sat, 28 Feb 2015 00:15:55 +0000 (02:15 +0200)]
tls: Pass AVOptions dictionaries through to the chained protocol

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agotcp: Clarify the units for the timeout avoptions
Martin Storsjö [Fri, 27 Feb 2015 23:37:18 +0000 (01:37 +0200)]
tcp: Clarify the units for the timeout avoptions

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoavio: Rename avclass symbols relating to avio
Martin Storsjö [Fri, 27 Feb 2015 23:06:28 +0000 (01:06 +0200)]
avio: Rename avclass symbols relating to avio

Don't prefix them ffio_url, which is misleading, sounding too
much like the urlprotocol layer (like ffurl_*).

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoconfigure: Move the cross_prefix setting after the toolchain one
Luca Barbato [Sun, 6 Apr 2014 22:47:42 +0000 (00:47 +0200)]
configure: Move the cross_prefix setting after the toolchain one

Makes passing to configure
--toolchain=gcc-asan --cross-prefix=armv7a-hardfloat-linux-gnueabi-
work as intended.

4 years agoxcbgrab: Unbreak parsing filename options
Luca Barbato [Sun, 22 Feb 2015 19:36:09 +0000 (20:36 +0100)]
xcbgrab: Unbreak parsing filename options

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agoxcbgrab: Provide better names for the y and x option
Luca Barbato [Sun, 22 Feb 2015 19:36:08 +0000 (20:36 +0100)]
xcbgrab: Provide better names for the y and x option

Incidentally `-y` also collides with avconv global options.

Update x11grab to match and document the option.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agomatroskaenc: Allow writing track "forced" flag
John Stebbins [Tue, 24 Feb 2015 20:44:48 +0000 (12:44 -0800)]
matroskaenc: Allow writing track "forced" flag

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agortpdec: Rename the free method to close
Martin Storsjö [Tue, 24 Feb 2015 15:01:48 +0000 (17:01 +0200)]
rtpdec: Rename the free method to close

Many of these functions were named foo_free_context, and since
the functions no longer should free the context itself, only
allocated elements within it, the previous naming was slightly
misleading.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolibavformat: Use ffio_free_dyn_buf where applicable
Martin Storsjö [Tue, 24 Feb 2015 12:07:54 +0000 (14:07 +0200)]
libavformat: Use ffio_free_dyn_buf where applicable

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpdec: Use ffio_free_dyn_buf
Martin Storsjö [Tue, 24 Feb 2015 11:37:03 +0000 (13:37 +0200)]
rtpdec: Use ffio_free_dyn_buf

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoavio: Add an internal utility function for freeing dynamic buffers
Martin Storsjö [Tue, 24 Feb 2015 11:23:30 +0000 (13:23 +0200)]
avio: Add an internal utility function for freeing dynamic buffers

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpdec: Free depacketizers if the init function failed
Martin Storsjö [Tue, 24 Feb 2015 11:18:10 +0000 (13:18 +0200)]
rtpdec: Free depacketizers if the init function failed

This is different from how it is handled in codecs/demuxers/muxers
though (where the close function isn't called if the open function
failed), but since the number of depacketizers that have an .init
function is quite limited, this is easy to change.

The main point is that if the init function failed, we shouldn't
try to use that depacketizer at all - this makes sure that the
parse function doesn't need to check for the things that were
initialized in the init function.

Signed-off-by: Martin Storsjö <martin@martin.st>