]> git.sesse.net Git - ffmpeg/log
ffmpeg
9 years agomkv: Validate ASS Start and End fields
Luca Barbato [Wed, 29 Oct 2014 19:39:46 +0000 (20:39 +0100)]
mkv: Validate ASS Start and End fields

CC: libav-stable@libav.org
9 years agoconfigure: enable vda hwaccel by default
Vittorio Giovara [Wed, 3 Dec 2014 03:12:40 +0000 (03:12 +0000)]
configure: enable vda hwaccel by default

Following the old thread suggestions.
Vittorio

9 years agompegvideo: exit cleanly when ff_mpv_common_frame_size_change() fails
Michael Niedermayer [Mon, 24 Nov 2014 17:05:04 +0000 (17:05 +0000)]
mpegvideo: exit cleanly when ff_mpv_common_frame_size_change() fails

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agompegvideo: free_context_frame() cannot fail, make it return void
Michael Niedermayer [Mon, 24 Nov 2014 17:05:03 +0000 (17:05 +0000)]
mpegvideo: free_context_frame() cannot fail, make it return void

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agompegvideo: replace assert about interlaced EC with debug av_log()
Michael Niedermayer [Mon, 24 Nov 2014 17:05:02 +0000 (17:05 +0000)]
mpegvideo: replace assert about interlaced EC with debug av_log()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agompeg12dec: Use more specific error codes
Michael Niedermayer [Mon, 24 Nov 2014 17:05:00 +0000 (17:05 +0000)]
mpeg12dec: Use more specific error codes

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agompeg12dec: Print error/warning messages on issues in mpeg1_decode_sequence()
Michael Niedermayer [Mon, 24 Nov 2014 17:04:58 +0000 (17:04 +0000)]
mpeg12dec: Print error/warning messages on issues in mpeg1_decode_sequence()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoexr: Add a gamma flag to exr loader to avoid banding
Gonzalo Garramuno [Tue, 2 Dec 2014 16:48:25 +0000 (16:48 +0000)]
exr: Add a gamma flag to exr loader to avoid banding

This is needed to avoid banding artifacts when gammaing the picture.
Currently, if done with a video filter, the process is done on uints
instead of full float.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agoh264: proper cleanup in ff_h264_alloc_tables() if DPB alloc fails
Michael Niedermayer [Tue, 2 Dec 2014 16:47:56 +0000 (16:47 +0000)]
h264: proper cleanup in ff_h264_alloc_tables() if DPB alloc fails

CC: libav-devel@libav.org
9 years agoh264: Fix memory leak on ff_h264_decode_init() failure
Dale Curtis [Tue, 2 Dec 2014 16:47:55 +0000 (16:47 +0000)]
h264: Fix memory leak on ff_h264_decode_init() failure

CC: libav-devel@libav.org
9 years agoDrop the unofficial extension prefix for MPEG and MPEG-TS formats
Florent Le Coz [Sat, 29 Nov 2014 16:53:47 +0000 (17:53 +0100)]
Drop the unofficial extension prefix for MPEG and MPEG-TS formats

As per the RFCs:
http://tools.ietf.org/html/rfc3555#page-38
http://tools.ietf.org/html/rfc3003

CC: libav-stable@libav.org
9 years agompegtsenc: recognize .mts as MPEG Transport Stream
Jean-Baptiste Mardelle [Sat, 29 Nov 2014 16:53:46 +0000 (17:53 +0100)]
mpegtsenc: recognize .mts as MPEG Transport Stream

9 years agoAdd support for BDAV/m2ts-mode muxing
Fredrik Axelsson [Sat, 29 Nov 2014 16:53:45 +0000 (17:53 +0100)]
Add support for BDAV/m2ts-mode muxing

Signed-off-by: Fredrik Axelsson <fraxbe@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agooptions_table: fix colorspace minimum option value
Jon Morley [Mon, 10 Nov 2014 18:43:42 +0000 (10:43 -0800)]
options_table: fix colorspace minimum option value

The min value for colorspace should be zero and not one since the first
valid index into the frame colorspace array is AVCOL_SPC_RGB which is 0.

9 years agomov: allocate the tag value dynamically
Thilo Borgmann [Sat, 29 Nov 2014 16:51:14 +0000 (17:51 +0100)]
mov: allocate the tag value dynamically

This allows to load metadata entries longer than 1024 bytes.
Displaying them is still limited to 1024 characters, but applications
can load them fully now.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agomov: Add an option for exporting all metadata
Vittorio Giovara [Sat, 29 Nov 2014 16:51:13 +0000 (17:51 +0100)]
mov: Add an option for exporting all metadata

9 years agomov: do not truncate the language-prefixed tag
Vittorio Giovara [Sat, 29 Nov 2014 16:51:12 +0000 (17:51 +0100)]
mov: do not truncate the language-prefixed tag

9 years agortsp: move the CONFIG_ macros to the beginning of the check
Vittorio Giovara [Sat, 29 Nov 2014 16:39:41 +0000 (17:39 +0100)]
rtsp: move the CONFIG_ macros to the beginning of the check

With --disable-optimizations, the DCE of some compilers does not remove
such unused code, causing linking failure.

9 years agoaac: Simplify decode_mid_side_stereo
Luca Barbato [Fri, 21 Nov 2014 12:57:36 +0000 (12:57 +0000)]
aac: Simplify decode_mid_side_stereo

Might spare few cycles if the compiler is naive and
makes the function more readable.

9 years agoMake the RELEASE file match with the most recent tag
Reinhard Tartler [Mon, 1 Dec 2014 03:31:31 +0000 (22:31 -0500)]
Make the RELEASE file match with the most recent tag

9 years agoReplace lena.pnm
Reinhard Tartler [Thu, 27 Nov 2014 17:21:03 +0000 (18:21 +0100)]
Replace lena.pnm

The new reference.pnm is a freely licensed replacement. The photo has
been taken by Reinhard Tartler on August 28 2014, and is licensed under
the expat license as stated at http://www.jclark.com/xml/copying.txt

9 years agoTreat all '*.pnm' files as non-text file
Reinhard Tartler [Fri, 28 Nov 2014 14:52:50 +0000 (09:52 -0500)]
Treat all '*.pnm' files as non-text file

This convinces the pre-receive hook to not consider all *.pnm files as
text files to reduce the patch sizes and avoids triggering whitespace
checks,

Contains a correction by Janne Grunau <janne-libav@jannau.net>

9 years agortmpproto: Fix a typo in a comment
Martin Storsjö [Fri, 28 Nov 2014 17:39:38 +0000 (19:39 +0200)]
rtmpproto: Fix a typo in a comment

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agodashenc: Avoid a VLA-like construct
Martin Storsjö [Fri, 28 Nov 2014 09:51:05 +0000 (11:51 +0200)]
dashenc: Avoid a VLA-like construct

This fixes the build on compilers that interpreted the earlier
code as a variable length array (which we intentionally disallow).

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agodashenc: Add options to make segment names configurable
Bryan Huh [Thu, 27 Nov 2014 09:46:02 +0000 (09:46 +0000)]
dashenc: Add options to make segment names configurable

This allows one to specify templated segment names for init-segments,
media-segments, and for the base-url in the case of single-file.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agortmpproto: Only prepend @setDataFrame for onMetaData and |RtmpSampleAccess
Martin Storsjö [Mon, 24 Nov 2014 08:51:46 +0000 (10:51 +0200)]
rtmpproto: Only prepend @setDataFrame for onMetaData and |RtmpSampleAccess

Currently, when streaming to an RTMP server, any time a packet of type
RTMP_PT_NOTIFY is encountered, the packet is prepended with @setDataFrame
before it gets sent to the server. This is incorrect; only packets for
onMetaData and |RtmpSampleAccess should invoke @setDataFrame on the RTMP
server. Specifically, the current bug manifests itself when trying to
stream onTextData or onCuePoint invocations.

This fix addresses that problem and ensures that the @setDataFrame is
only prepended for onMetaData and |RtmpSampleAccess.

Since data is fed to the rtmp_write function in smaller pieces (depending
on the calling IO buffer size), we can't generally assume that the
whole packet (or even the whole command string) is available at once,
therefore we can only check the command string once the full packet
has been transferred to us for sending.

Based on a patch by Jeffrey Wescott.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agortmppkt: Make pkt->data reallocable
Martin Storsjö [Mon, 24 Nov 2014 08:41:34 +0000 (10:41 +0200)]
rtmppkt: Make pkt->data reallocable

We try to avoid mixing av_malloc with av_realloc, since av_malloc
may be implemented with functions that can't (formally) be mixed
with the functions used in av_realloc.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agortmpproto: Simplify code for copying data into the output packet
Martin Storsjö [Mon, 24 Nov 2014 08:17:20 +0000 (10:17 +0200)]
rtmpproto: Simplify code for copying data into the output packet

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agortmpproto: Clarify a comment
Martin Storsjö [Mon, 24 Nov 2014 08:02:11 +0000 (10:02 +0200)]
rtmpproto: Clarify a comment

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoopusdec: make sure all substreams have the same number of coded samples
Anton Khirnov [Mon, 24 Nov 2014 10:16:46 +0000 (11:16 +0100)]
opusdec: make sure all substreams have the same number of coded samples

Fixes invalid writes with invalid multichannel streams.

CC:libav-stable@libav.org

9 years agovf_interlace: get rid of useless loads
Kieran Kunhya [Tue, 25 Nov 2014 16:14:32 +0000 (17:14 +0100)]
vf_interlace: get rid of useless loads

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agolavu: fix memory leaks by using a mutex instead of atomics
wm4 [Fri, 14 Nov 2014 12:34:50 +0000 (13:34 +0100)]
lavu: fix memory leaks by using a mutex instead of atomics

The buffer pool has to atomically add and remove entries from the linked
list of available buffers. This was done by removing the entire list
with a CAS operation, working on it, and then setting it back again
(using a retry-loop in case another thread was doing the same thing).

This could effectively cause memory leaks: while a thread was working on
the buffer list, other threads would allocate new buffers, increasing
the pool's total size. There was no real leak, but since these extra
buffers were not needed, but not free'd either (except when the buffer
pool was destroyed), this had the same effects as a real leak. For some
reason, growth was exponential, and could easily kill the process due
to OOM in real-world uses.

Fix this by using a mutex to protect the list operations. The fancy
way atomics remove the whole list to work on it is not needed anymore,
which also avoids the situation which was causing the leak.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agolavu: add wrappers for the pthreads mutex API
Anton Khirnov [Sun, 23 Nov 2014 20:25:05 +0000 (21:25 +0100)]
lavu: add wrappers for the pthreads mutex API

Also add no-op fallbacks when threading is disabled.

This helps keeping the code clean if Libav is compiled for targets
without threading. Since we assume that no threads of any kind are used
in such configurations, doing nothing is ok by definition.

Based on a patch by wm4 <nfxjfg@googlemail.com>.

9 years agoRevert "lavf: Don't try to update files atomically with renames on windows"
Martin Storsjö [Tue, 25 Nov 2014 08:51:23 +0000 (10:51 +0200)]
Revert "lavf: Don't try to update files atomically with renames on windows"

This reverts commit b9d08c77a44390b0848c06f20bc0e9e951ba6a3c.

After taking MoveFileEx into use, we can replace files with renames
on windows as well.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agolavf: Use MoveFileEx instead of rename/_wrename on windows
Martin Storsjö [Tue, 25 Nov 2014 09:08:59 +0000 (11:08 +0200)]
lavf: Use MoveFileEx instead of rename/_wrename on windows

This allows getting the normal unix semantics, where a rename
allows replacing an existing file.

Based on a suggestion by Reimar Döffinger.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoShare the utf8 to wchar conversion routine between lavf and lavu
Martin Storsjö [Tue, 25 Nov 2014 08:39:50 +0000 (10:39 +0200)]
Share the utf8 to wchar conversion routine between lavf and lavu

This doesn't add any dependency on library internals, since this
only is a static inline function that gets built into each of the
calling functions - this is only to reduce the code duplication.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Expose the fragment index as an avoption
Martin Storsjö [Mon, 3 Nov 2014 20:38:09 +0000 (22:38 +0200)]
movenc: Expose the fragment index as an avoption

This allows setting the right fragment number if doing
random-access writing of fragments, and also allows reading the
current sequence number.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Add a flag for indicating a discontinuous fragment
Martin Storsjö [Thu, 20 Nov 2014 07:51:05 +0000 (09:51 +0200)]
movenc: Add a flag for indicating a discontinuous fragment

This allows creating a later mp4 fragment without sequentially
writing the earlier ones before (when called from a segmenter).

Normally when writing a fragmented mp4 file sequentially, the
first timestamps of a fragment are adjusted to match the
end of the previous fragment, to make sure the timestamp is the
same, even if it is calculated as the sum of previous fragment
durations. (And for the first packet in a file, the offset of
the first packet is written using an edit list.)

When writing an individual mp4 fragment discontinuously like this
(with potentially writing the earlier fragments separately later),
there's a risk of getting a gap in the timeline if the duration
field of the last packet in the previous fragment doesn't match up
with the start time of the next fragment.

Using this requires setting -avoid_negative_ts make_non_negative
(or -avoid_negative_ts 0).

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agovorbis_parser: Include stdint.h in the header, to make it work standalone
Martin Storsjö [Tue, 25 Nov 2014 08:43:55 +0000 (10:43 +0200)]
vorbis_parser: Include stdint.h in the header, to make it work standalone

This fixes "make checkheaders".

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agovf_interlace: x86: improve asm performance
Michael Niedermayer [Sat, 15 Nov 2014 03:07:08 +0000 (04:07 +0100)]
vf_interlace: x86: improve asm performance

4775 decicycles -> 3688 decicycles

9 years agohnm4: change width/height to int to fix hypothetical integer overflows
Michael Niedermayer [Wed, 12 Nov 2014 10:13:08 +0000 (11:13 +0100)]
hnm4: change width/height to int to fix hypothetical integer overflows

CC: libav-stable@libav.org
Bug-Id: CID 1135770 / CID 1135771

9 years agohnm4: Use av_image_check_size
Luca Barbato [Mon, 24 Nov 2014 00:04:39 +0000 (01:04 +0100)]
hnm4: Use av_image_check_size

As done for all the other codecs not calling it indirectly.

CC: libav-stable@libav.org
Bug-Id: CID 1135770 / CID 1135771

9 years agovc1: Use the correct shift amount
Michael Niedermayer [Sun, 23 Nov 2014 23:44:48 +0000 (00:44 +0100)]
vc1: Use the correct shift amount

`is_intra` is a 6bits bitfield.

CC: libav-stable@libav.org
Bug-Id: CID 1194380 / CID 1194381

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agovc1: Set the is_intra bitfield to all 1 when needed
Luca Barbato [Sun, 23 Nov 2014 23:44:47 +0000 (00:44 +0100)]
vc1: Set the is_intra bitfield to all 1 when needed

Keep the code as similar as possible across the codepaths to
ease spotting it for factorization.

Based on a patch from Michael Niedermayer <michaelni@gmx.at>.

9 years agovc1: Simplify a little setting the intra variables
Luca Barbato [Sun, 23 Nov 2014 23:44:46 +0000 (00:44 +0100)]
vc1: Simplify a little setting the intra variables

The code currently set the information in at least 4 places, spare
some pointless loops.

Make the code in the loop a little uniform to make easier factorize
it out later.

9 years agovorbis_parser: Move vp check to avoid a null pointer dereference
Michael Niedermayer [Mon, 24 Nov 2014 15:48:27 +0000 (15:48 +0000)]
vorbis_parser: Move vp check to avoid a null pointer dereference

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

9 years agolpc: remove unneeded {}
Michael Niedermayer [Mon, 24 Nov 2014 16:06:00 +0000 (16:06 +0000)]
lpc: remove unneeded {}

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agovc1pred: remove logically dead code
Vittorio Giovara [Mon, 24 Nov 2014 01:38:53 +0000 (01:38 +0000)]
vc1pred: remove logically dead code

CC: libav-stable@libav.org
Bug-Id: CID 1245699 / CID 1245700

9 years agolavf: Use wchar functions for filenames on windows for mkdir/rmdir/rename/unlink
Martin Storsjö [Mon, 17 Nov 2014 21:08:15 +0000 (23:08 +0200)]
lavf: Use wchar functions for filenames on windows for mkdir/rmdir/rename/unlink

This makes sure that the internal utf8 path names are handled
properly - the normal file handling functions assume path names
are in the native codepage, which isn't utf8.

This assumes that the tools outside of lavf don't use the mkdir
definition. (The tools don't do the same reading of command line
parameters as wchar either - they probably won't handle all possible
unicode file parameters properly, but at least work more predictably
if no utf8/wchar conversion is involved.)

This is moved further down in os_support.h, since windows.h shouldn't
be included before winsock2.h, while io.h needs to be included before
the manual defines for lseek functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agolavf: Don't try to update files atomically with renames on windows
Martin Storsjö [Tue, 18 Nov 2014 12:06:19 +0000 (14:06 +0200)]
lavf: Don't try to update files atomically with renames on windows

On windows, rename(2) will fail if the target file exists. On
unix this trick is used to make sure that people reading the file
either will get the full previous file, or the full new version
of the file, but no intermediate version.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoflvdec: Document how the duration is retrieved at the end of the file
Uwe L. Korn [Sun, 23 Nov 2014 18:36:14 +0000 (19:36 +0100)]
flvdec: Document how the duration is retrieved at the end of the file

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agodashenc: Don't segment all video streams when one stream gets a keyframe
Martin Storsjö [Mon, 17 Nov 2014 13:26:17 +0000 (15:26 +0200)]
dashenc: Don't segment all video streams when one stream gets a keyframe

This makes sure that segments actually start at a keyframe (and
makes sure we don't split segments twice in a row, with one segment
consisting of only a handful of packets), when one stream uses b-frames
while another one doesn't.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agosidxindex: Write mimeType=audio/mp4 for audio-only representations
Martin Storsjö [Sun, 23 Nov 2014 15:30:35 +0000 (17:30 +0200)]
sidxindex: Write mimeType=audio/mp4 for audio-only representations

This fixes playback with dash.js, when the input is one separate
mp4 file per track.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoaacsbr: always initialize max_qmf_subbands
Vittorio Giovara [Fri, 21 Nov 2014 12:57:37 +0000 (12:57 +0000)]
aacsbr: always initialize max_qmf_subbands

Fixes a wordly warning from clang -Wsometimes-uninitialized.

9 years agoroqaudio: Always use the frame buffer on flush
Michael Niedermayer [Wed, 12 Nov 2014 10:13:10 +0000 (11:13 +0100)]
roqaudio: Always use the frame buffer on flush

Prevent NULL dereference.

CC: libav-stable@libav.org
Bug-Id: CID 703669
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agotiffenc: initialize return value
Vittorio Giovara [Sun, 9 Nov 2014 07:48:43 +0000 (08:48 +0100)]
tiffenc: initialize return value

'ret' can only be used without initialization if s->height <= 0, which can
only happen if avctx->height <= 0, which is validated elsewhere. Doesn't hurt
to still initialize it though.

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

9 years agocook: Make sure there is enough extradata
Luca Barbato [Sun, 23 Nov 2014 15:09:05 +0000 (16:09 +0100)]
cook: Make sure there is enough extradata

At least 8 bytes are needed (Mono audio).

Bug-Id: CID 741418
CC: libav-stable@libav.org
9 years agosol: simplify sol_codec_id()
Vittorio Giovara [Fri, 21 Nov 2014 12:57:35 +0000 (12:57 +0000)]
sol: simplify sol_codec_id()

Bug-Id: CID 1238993

9 years agoaacdec: avoid an out-of-bounds write
Vittorio Giovara [Fri, 21 Nov 2014 12:57:40 +0000 (12:57 +0000)]
aacdec: avoid an out-of-bounds write

Also move the check in the case it is actually used.

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

9 years agolavu: move internal define to the only places where it is used
Vittorio Giovara [Fri, 21 Nov 2014 12:57:43 +0000 (12:57 +0000)]
lavu: move internal define to the only places where it is used

9 years agompegenc: prevent a NULL pointer dereference
Vittorio Giovara [Fri, 21 Nov 2014 12:57:42 +0000 (12:57 +0000)]
mpegenc: prevent a NULL pointer dereference

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

9 years agomotion_est: convert stride to ptrdiff_t
Vittorio Giovara [Fri, 21 Nov 2014 12:57:41 +0000 (12:57 +0000)]
motion_est: convert stride to ptrdiff_t

CC: libav-stable@libav.org
Bug-Id: CID 700556 / CID 700557 / CID 700558

9 years agodashenc: Don't require the stream bitrate to be known
Martin Storsjö [Wed, 19 Nov 2014 11:49:31 +0000 (13:49 +0200)]
dashenc: Don't require the stream bitrate to be known

Don't write any bitrate attribute if it isn't known. As long as one
doesn't want automatic bitrate switching, playback can work just
fine even if it isn't set.

If strict standard compliance is requested, this is still considered
an error, since the attribute is mandatory according to the spec.

Based on a patch by Rodger Combs.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agolavf: Remove a redundant include of sys/stat.h
Martin Storsjö [Tue, 18 Nov 2014 07:57:07 +0000 (09:57 +0200)]
lavf: Remove a redundant include of sys/stat.h

The same file already includes this header a few lines further
above.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoflvenc: Remove an unused variable
Michael Niedermayer [Mon, 17 Nov 2014 12:08:05 +0000 (13:08 +0100)]
flvenc: Remove an unused variable

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agohevc: Spin the mv_mpv_mode calls in a stand alone function
Luca Barbato [Sun, 16 Nov 2014 10:29:41 +0000 (11:29 +0100)]
hevc: Spin the mv_mpv_mode calls in a stand alone function

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agoqdm2: avoid integer overflow
Vittorio Giovara [Wed, 12 Nov 2014 18:10:44 +0000 (19:10 +0100)]
qdm2: avoid integer overflow

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

9 years agovp9: Use the correct upper bound for seg_id
Luca Barbato [Tue, 11 Nov 2014 12:27:01 +0000 (13:27 +0100)]
vp9: Use the correct upper bound for seg_id

And use a macro to make apparent why the value.

Bug-Id: CID 1108595

9 years agodvdsubdec: Do not leak on failure path
Luca Barbato [Sun, 9 Nov 2014 07:48:47 +0000 (08:48 +0100)]
dvdsubdec: Do not leak on failure path

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

9 years agolibtwolame: prevent a NULL pointer dereference
Vittorio Giovara [Fri, 21 Nov 2014 11:56:59 +0000 (11:56 +0000)]
libtwolame: prevent a NULL pointer dereference

CC: libav-stable@libav.org
Bug-Id: CID 1250330 / CID 1250335

9 years agolavfi: clean memory on error in ADD_FORMAT()
Vittorio Giovara [Sun, 16 Nov 2014 23:22:20 +0000 (00:22 +0100)]
lavfi: clean memory on error in ADD_FORMAT()

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

9 years agoxwma: Do not leak on failure path
Luca Barbato [Sun, 16 Nov 2014 23:22:21 +0000 (00:22 +0100)]
xwma: Do not leak on failure path

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

9 years agolavc: Move the libtwolame encoder registration to the list for external libraries
Martin Storsjö [Fri, 21 Nov 2014 12:23:02 +0000 (14:23 +0200)]
lavc: Move the libtwolame encoder registration to the list for external libraries

This makes sure the default behaviour of using the internal encoder
stays the same regardless if libtwolame is enabled or not (as for
any external library).

This fixes fate-lavf-mpg if libav is built with libtwolame enabled.

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agohdsenc: Clear the previous codec tag when setting up the chained muxer
Martin Storsjö [Tue, 18 Nov 2014 12:28:50 +0000 (14:28 +0200)]
hdsenc: Clear the previous codec tag when setting up the chained muxer

The chained flv muxer wants one set of tags - normally this set
could be signaled via the AVOutputFormat codec_tag field (as
smoothstreamingenc and dashenc do). hdsenc doesn't signal it, since
the FLV codec tag arrays aren't exported from flvenc.c. This can
lead to the caller keeping an original codec tag from the originating
container here, which would then be a mismatch for the FLV muxer.
Since we don't really care about what codec tag the caller might
have set, just clear it and let the lavf muxer layer set the right
one for the chained FLV muxer later instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agohdsenc: Use the right filename in an error message
Martin Storsjö [Tue, 18 Nov 2014 12:16:41 +0000 (14:16 +0200)]
hdsenc: Use the right filename in an error message

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoconfigure: Fix enabling memalign_hack automatically
Martin Storsjö [Tue, 18 Nov 2014 11:52:26 +0000 (13:52 +0200)]
configure: Fix enabling memalign_hack automatically

simd_align_16 is a configure item that can be enabled or disabled,
it's not a variable containing a list of other configure items
as need_memalign previously. This was broken in eba2233b5.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomov: check ff_get_wav_header() return value
Vittorio Giovara [Sun, 16 Nov 2014 23:22:23 +0000 (00:22 +0100)]
mov: check ff_get_wav_header() return value

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

9 years agolavc: fix bitshifts amount bigger than the type
Vittorio Giovara [Sun, 16 Nov 2014 23:22:27 +0000 (00:22 +0100)]
lavc: fix bitshifts amount bigger than the type

CC: libav-stable@libav.org
Bug-Id: CID 1194387 / CID 1194389 / CID 1194393 / CID 1206638

9 years agolibvpxenc: clean memory on error
Vittorio Giovara [Sun, 16 Nov 2014 23:22:28 +0000 (00:22 +0100)]
libvpxenc: clean memory on error

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

9 years agolibrtmp: append the correct field to the string
Vittorio Giovara [Sun, 16 Nov 2014 23:22:22 +0000 (00:22 +0100)]
librtmp: append the correct field to the string

Also prevent a NULL pointer dereference.

CC: libav-stable@libav.org
Bug-Id: CID 1250329 / CID 1250331

9 years agolavf: Only initialize s->offset once when using avoid_negative_ts make_zero
Martin Storsjö [Mon, 17 Nov 2014 11:31:47 +0000 (13:31 +0200)]
lavf: Only initialize s->offset once when using avoid_negative_ts make_zero

When given a stream starting at dts=0, it would previously consider
s->offset as uninitialized and set an offset when the second packet
was written, ending up writing two packets with dts=0. By initializing
this field to AV_NOPTS_VALUE, we make sure that we only initialize it
once, on the first packet.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agotools: Add a sidxindex tool
Martin Storsjö [Wed, 29 Oct 2014 09:43:34 +0000 (11:43 +0200)]
tools: Add a sidxindex tool

This tool can write an MPD file for fragmented MP4 files with
a sidx index at the start of the file.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Allow writing a DASH sidx atom at the start of files
Martin Storsjö [Tue, 21 Oct 2014 08:42:27 +0000 (11:42 +0300)]
movenc: Allow writing a DASH sidx atom at the start of files

This is mapped to the faststart flag (which in this case
perhaps should be called "shift and write index at the
start of the file"), which for fragmented files will
write a sidx index at the start.

When segmenting DASH into files, there's usually one sidx
at the start of each segment (although it's not clear to me
whether that actually is necessary). When storing all of it
in one file, the MPD doesn't necessarily need to describe
the individual segments, but the offsets of the fragments can be
fetched from one large sidx atom at the start of the file. This
allows creating files for the DASH ISO BMFF on-demand profile.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Add tfra entries for all tracks in a moof
Martin Storsjö [Sun, 12 Oct 2014 20:49:22 +0000 (23:49 +0300)]
movenc: Add tfra entries for all tracks in a moof

Previously only tfra entries were added for the first track in each moof.

The frag_info array used for tfra can also be used for writing
other kinds of fragment indexes, where it's more important to
include all tracks.

When the separate_moof option is enabled (as in ismv), we write
a separate moof for each track, so this doesn't make any difference
in that case.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agolavf: Add an MPEG-DASH ISOFF segmenting muxer
Martin Storsjö [Mon, 6 Oct 2014 08:36:17 +0000 (11:36 +0300)]
lavf: Add an MPEG-DASH ISOFF segmenting muxer

This is mostly to serve as a reference example on how to segment
the output from the mp4 muxer, capable of writing the segment
list in four different ways:
- SegmentTemplate with SegmentTimeline
- SegmentTemplate with implicit segments
- SegmentList with individual files
- SegmentList with one single file per track, and byte ranges

The muxer is able to serve live content (with optional windowing)
or create a static segmented MPD.

In advanced cases, users will probably want to do the segmenting
in their own application code.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Add support for writing sidx atoms for DASH segments
Martin Storsjö [Sun, 5 Oct 2014 20:51:47 +0000 (23:51 +0300)]
movenc: Add support for writing sidx atoms for DASH segments

A flag "dash" is added, which enables the necessary flags for
creating DASH compatible fragments.

When this is enabled, one sidx atom is written for each track
before every moof atom.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Factorize adding fragment info into a separate function
Martin Storsjö [Sun, 12 Oct 2014 20:37:17 +0000 (23:37 +0300)]
movenc: Factorize adding fragment info into a separate function

By calling this after writing the moof the first time (for
calculating the moof size), we can avoid intermediate storage
of tfrf_offset in MOVTrack.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Include empty tracks in iods when writing fragmented mp4
Martin Storsjö [Mon, 3 Nov 2014 21:44:02 +0000 (23:44 +0200)]
movenc: Include empty tracks in iods when writing fragmented mp4

When writing fragmented streams with an empty initial moov,
we won't have any samples in any tracks when writing the
moov atom, thus trust that any tracks that are added actually
will be present.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoflvenc: Send new metadata when FLAG_METADATA_UPDATED is set.
Andrew Stone [Fri, 7 Nov 2014 21:09:10 +0000 (16:09 -0500)]
flvenc: Send new metadata when FLAG_METADATA_UPDATED is set.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agoflvenc: move metadata updates into a single function
Andrew Stone [Fri, 7 Nov 2014 21:09:09 +0000 (16:09 -0500)]
flvenc: move metadata updates into a single function

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agohevc: remove superfluous assignments and checks
Anton Khirnov [Sun, 16 Nov 2014 07:23:19 +0000 (08:23 +0100)]
hevc: remove superfluous assignments and checks

9 years agohevc: eliminate an unneeded intermediate variable
Anton Khirnov [Sun, 16 Nov 2014 07:15:42 +0000 (08:15 +0100)]
hevc: eliminate an unneeded intermediate variable

9 years agohevc: reduce variable scope
Anton Khirnov [Sun, 16 Nov 2014 07:13:46 +0000 (08:13 +0100)]
hevc: reduce variable scope

Also, collapse the array into a scalar, since only one value is needed
at a time.

9 years agohevc: further reduce code duplication in hls_prediction_unit()
Anton Khirnov [Sun, 16 Nov 2014 07:06:27 +0000 (08:06 +0100)]
hevc: further reduce code duplication in hls_prediction_unit()

9 years agohevc: reduce code duplication in hls_prediction_unit()
Anton Khirnov [Sun, 16 Nov 2014 07:02:18 +0000 (08:02 +0100)]
hevc: reduce code duplication in hls_prediction_unit()

9 years agohevcdsp_template: templatize transquant_bypass
Anton Khirnov [Sat, 15 Nov 2014 21:31:27 +0000 (22:31 +0100)]
hevcdsp_template: templatize transquant_bypass

9 years agohevc: remove an unused function parameter
Anton Khirnov [Sat, 15 Nov 2014 20:18:51 +0000 (21:18 +0100)]
hevc: remove an unused function parameter

9 years agohevc: remove a redundant line
Anton Khirnov [Sat, 15 Nov 2014 19:40:12 +0000 (20:40 +0100)]
hevc: remove a redundant line

pred_mode is overwritten a few lines immediately below.

9 years agohevc: do not store rqt_root_cbf in the context
Anton Khirnov [Sat, 15 Nov 2014 19:00:22 +0000 (20:00 +0100)]
hevc: do not store rqt_root_cbf in the context

It does not need to be accessed outside of hls_coding_unit().

9 years agohevc: do not store pcm_flag in the context
Anton Khirnov [Sat, 15 Nov 2014 19:00:22 +0000 (20:00 +0100)]
hevc: do not store pcm_flag in the context

It does not need to be accessed outside of hls_coding_unit().