ffmpeg.git
4 years agoopt: Fix the documentation mentioning av_set_string3
Luca Barbato [Tue, 11 Nov 2014 01:39:27 +0000 (02:39 +0100)]
opt: Fix the documentation mentioning av_set_string3

It is av_opt_set now.

4 years agoh264_parser: don't stop on SPS_EXT in split
John Stebbins [Fri, 31 Oct 2014 15:24:38 +0000 (08:24 -0700)]
h264_parser: don't stop on SPS_EXT in split

Add SPS_EXT, SEI, and subset SPS to codes that are skipped during split.
These codes can come before the PPS and results in incomplete extradata.

4 years agoh264_cabac: fix one fill_rectangle() indentation level
Michael Niedermayer [Mon, 10 Nov 2014 07:43:08 +0000 (08:43 +0100)]
h264_cabac: fix one fill_rectangle() indentation level

Bug-Id: CID 1087088

4 years agopng_parser: fix size of chunk_lenght
Vittorio Giovara [Sun, 9 Nov 2014 07:48:35 +0000 (08:48 +0100)]
png_parser: fix size of chunk_lenght

Fixes the comparison against constant value 0x7fffffff.

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

4 years agodvbsubdec: move shared codepath
Vittorio Giovara [Sun, 9 Nov 2014 07:48:45 +0000 (08:48 +0100)]
dvbsubdec: move shared codepath

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

4 years agodvbsubdec: improve error checking
Vittorio Giovara [Sun, 9 Nov 2014 07:48:44 +0000 (08:48 +0100)]
dvbsubdec: improve error checking

Use av_mallocz_array instead of iterating and check the returned memory.
Check returned memory and cleanly exit in case of error during the loop.
Avoid a null pointer dereference for invalid data.

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

4 years agodvbsubdec: add missing break
Jernej Fijačko [Sun, 9 Nov 2014 07:48:46 +0000 (08:48 +0100)]
dvbsubdec: add missing break

Fix a memory leak too.

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

4 years agohevc_cabac: decrease CABAC_MAX_BIN
Michael Niedermayer [Sun, 9 Nov 2014 07:48:38 +0000 (08:48 +0100)]
hevc_cabac: decrease CABAC_MAX_BIN

Prevents shifts with undefined behavior, as no syntax element has a valid
value greater than 1 << 31.

Bug-Id: CID 1206635

4 years agohevc_mvs: prevent unitialized use
Vittorio Giovara [Sun, 9 Nov 2014 07:48:39 +0000 (08:48 +0100)]
hevc_mvs: prevent unitialized use

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

4 years ago4xm: drop unnecessary check
Vittorio Giovara [Sun, 9 Nov 2014 07:48:40 +0000 (08:48 +0100)]
4xm: drop unnecessary check

data_size is always >= 0 in this case.

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

4 years agohpeldsp: Increase put_no_rnd_pixels_tab[][] size
Michael Niedermayer [Tue, 4 Nov 2014 14:36:53 +0000 (09:36 -0500)]
hpeldsp: Increase put_no_rnd_pixels_tab[][] size

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

4 years agomjpegenc: fix argument size in encode_mb
Vittorio Giovara [Wed, 5 Nov 2014 14:40:30 +0000 (09:40 -0500)]
mjpegenc: fix argument size in encode_mb

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

4 years agompegvideo: fix size of array
Vittorio Giovara [Tue, 4 Nov 2014 14:37:01 +0000 (09:37 -0500)]
mpegvideo: fix size of array

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

4 years agompegvideo: check mpv return value
Vittorio Giovara [Tue, 4 Nov 2014 14:37:00 +0000 (09:37 -0500)]
mpegvideo: check mpv return value

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

4 years agompeg12enc: increase declared size of block function argument
Michael Niedermayer [Tue, 4 Nov 2014 14:36:58 +0000 (09:36 -0500)]
mpeg12enc: increase declared size of block function argument

CC: libav-stable@libav.org
Bug-Id: CID 1047236
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agolibavcodec: Unconditionally build xiph.o
Martin Storsjö [Mon, 10 Nov 2014 08:14:45 +0000 (10:14 +0200)]
libavcodec: Unconditionally build xiph.o

vorbis_parser.o is built unconditionally since 5e80fb7ff, and the
unconditionally built parts of it depend on xiph.o.

This fixes builds with --disable-everything.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agov4l2: Unify one instance of reading/storing errno
Martin Storsjö [Mon, 10 Nov 2014 07:49:01 +0000 (09:49 +0200)]
v4l2: Unify one instance of reading/storing errno

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolibfdk-aacdec: Support building with the latest version of fdk-aac
Martin Storsjö [Tue, 4 Nov 2014 08:22:05 +0000 (10:22 +0200)]
libfdk-aacdec: Support building with the latest version of fdk-aac

The latest fdk-aac code drop (from android 5.0) changed the channel
layout enums (changing the value of existing enum constants), and
renamed the option for downmixing.

The failsafe comparison between ctype and FF_ARRAY_ELEMS(channel_counts)
can trigger warnings (-Wtautological-constant-out-of-range-compare)
when building with the old FDK AAC releases, where it can't be
out of range with the enum values used there.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agov4l2: Preserve errno values
Luca Barbato [Thu, 6 Nov 2014 08:58:03 +0000 (09:58 +0100)]
v4l2: Preserve errno values

av_log usually resets it.

4 years agov4l2: Use av_strerror
Tristan Matthews [Wed, 5 Nov 2014 20:09:40 +0000 (15:09 -0500)]
v4l2: Use av_strerror

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agolavc: Compact the side-data passthrough
Luca Barbato [Tue, 4 Nov 2014 20:11:47 +0000 (21:11 +0100)]
lavc: Compact the side-data passthrough

4 years agomovenc: Require samples before trying to write edts
Martin Storsjö [Mon, 3 Nov 2014 18:13:36 +0000 (20:13 +0200)]
movenc: Require samples before trying to write edts

This avoids a potential crash if writing a fragmented psp mp4
(which probably is only a hypothetical scenario).

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Avoid leaking locally allocated data when returning on errors
Martin Storsjö [Sun, 2 Nov 2014 21:50:47 +0000 (23:50 +0200)]
movenc: Avoid leaking locally allocated data when returning on errors

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Remove an outdated comment
Martin Storsjö [Mon, 3 Nov 2014 13:27:42 +0000 (15:27 +0200)]
movenc: Remove an outdated comment

QuickTime does support files with an empty initial movie
these days.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Write correct presentation timestamps in tfra
Martin Storsjö [Sat, 11 Oct 2014 21:24:31 +0000 (00:24 +0300)]
movenc: Write correct presentation timestamps in tfra

Previously we wrote decoding timestamps here, while the specs
say it should be presentation timestamps.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Remove a now redundant check
Martin Storsjö [Wed, 29 Oct 2014 21:26:40 +0000 (23:26 +0200)]
movenc: Remove a now redundant check

When using the new first_trun flag instead of checking the track id,
we don't need to have a special case for the separate_moof flag
any longer.

This simplifies the complicated codepath ever so slightly.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Allow to request not to use edit lists
Martin Storsjö [Tue, 4 Nov 2014 14:28:48 +0000 (16:28 +0200)]
movenc: Allow to request not to use edit lists

In this case, shift tracks to start from zero instead (potentially
stretching the first sample in tracks that start later than the
first one).

Some software does not support edit lists at all, the adobe flash
player seems to be one of these. This results in AV sync errors when
edit lists are used to adjust AV sync.

Some players, such as QuickTime, don't respect the duration for
audio packets, so if an audio track starts later than the video
track and the first audio sample gets a duration longer than the
actual amount of data in it, the result will be out of sync.

Based on patches by Michael Niedermayer.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolavf: Print a warning if failed to avoid negative timestamps when requested
Michael Niedermayer [Wed, 22 Oct 2014 14:15:02 +0000 (16:15 +0200)]
lavf: Print a warning if failed to avoid negative timestamps when requested

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolavf: Add an option for avoiding negative timestamps
Michael Niedermayer [Wed, 26 Sep 2012 13:55:16 +0000 (15:55 +0200)]
lavf: Add an option for avoiding negative timestamps

This is the same logic as is invoked on AVFMT_TS_NEGATIVE,
but which can be enabled manually, or can be enabled
in muxers which only need it in certain conditions.

Also allow using the same mechanism to force streams to start
at 0.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoavstring: Mark some character handling functions av_const
Henrik Gramner [Tue, 4 Nov 2014 23:05:42 +0000 (00:05 +0100)]
avstring: Mark some character handling functions av_const

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomjpegdec: fix undefined shift
Vittorio Giovara [Wed, 5 Nov 2014 15:29:55 +0000 (10:29 -0500)]
mjpegdec: fix undefined shift

Add a comment to explain the code.

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

4 years agopthreads_frame: Do not leak on failure path
Luca Barbato [Thu, 30 Oct 2014 00:51:59 +0000 (00:51 +0000)]
pthreads_frame: Do not leak on failure path

CC: libav-stable@libav.org
Bug-Id: CID 1135767
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agompeg12dec: simplify context duplication
Vittorio Giovara [Tue, 4 Nov 2014 14:36:59 +0000 (09:36 -0500)]
mpeg12dec: simplify context duplication

CC: libav-stable@libav.org
Bug-Id: CID 717453 / CID 717454 / CID 717915

4 years agompeg12enc: factor out check in encode_dc
Vittorio Giovara [Tue, 4 Nov 2014 14:36:57 +0000 (09:36 -0500)]
mpeg12enc: factor out check in encode_dc

Makes coverity less confused and the code more readable.

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

4 years agompegvideo_enc: factor out denominator and explicitly cast operands
Vittorio Giovara [Tue, 4 Nov 2014 14:37:04 +0000 (09:37 -0500)]
mpegvideo_enc: factor out denominator and explicitly cast operands

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

4 years agompegvideo_enc: rework direct mode check
Vittorio Giovara [Tue, 4 Nov 2014 14:37:03 +0000 (09:37 -0500)]
mpegvideo_enc: rework direct mode check

Remove stray semicolon and share codepaths.

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

4 years agonutdec: do not set has_b_frames
Anton Khirnov [Thu, 30 Oct 2014 06:51:15 +0000 (07:51 +0100)]
nutdec: do not set has_b_frames

It is not supposed to be set by demuxers.

4 years agolavc: make avpriv_flac_is_extradata_valid() private on the next bump
Anton Khirnov [Thu, 28 Aug 2014 18:42:56 +0000 (18:42 +0000)]
lavc: make avpriv_flac_is_extradata_valid() private on the next bump

4 years agooggenc: accept only STREAMINFO extradata
Anton Khirnov [Thu, 28 Aug 2014 18:51:51 +0000 (18:51 +0000)]
oggenc: accept only STREAMINFO extradata

The reasoning is the same as for
0097cbea695e534fce39958ccd103af2fbf65831.

4 years agolavc: make avpriv_flac_parse_streaminfo() private on the next bump
Anton Khirnov [Thu, 28 Aug 2014 18:42:56 +0000 (18:42 +0000)]
lavc: make avpriv_flac_parse_streaminfo() private on the next bump

4 years agolavf: stop using avpriv_flac_parse_streaminfo()
Anton Khirnov [Thu, 28 Aug 2014 10:13:25 +0000 (10:13 +0000)]
lavf: stop using avpriv_flac_parse_streaminfo()

The only parameters needed by the demuxers are the sample rate and sample
count, which can be trivially extracted manually, without resorting to
an avpriv function.

4 years agoriffenc: do not fall back on AVCodecContext.frame_size for MP3
Anton Khirnov [Sun, 24 Aug 2014 10:28:32 +0000 (10:28 +0000)]
riffenc: do not fall back on AVCodecContext.frame_size for MP3

It will not be set unless the codec context is used as the encoding
context, which is discouraged. For MP2, av_get_audio_frame_duration()
will already set the frame size properly. For MP3, set the frame size
explicitly.

4 years agolavf: use the format context strict_std_compliance instead of the codec one
Anton Khirnov [Sat, 5 Jul 2014 09:56:16 +0000 (09:56 +0000)]
lavf: use the format context strict_std_compliance instead of the codec one

4 years agolavc,lavf: switch to the new vorbis parse API
Anton Khirnov [Wed, 29 Oct 2014 15:35:26 +0000 (16:35 +0100)]
lavc,lavf: switch to the new vorbis parse API

4 years agolavc: add a public API for parsing vorbis packets.
Anton Khirnov [Wed, 29 Oct 2014 14:04:23 +0000 (15:04 +0100)]
lavc: add a public API for parsing vorbis packets.

It is required by (at least) the ogg demuxer.

Mark the current semi-public apriv API for removal.

4 years agovorbis_parser: add an AV prefix to VorbisParseContext
Anton Khirnov [Wed, 29 Oct 2014 13:33:32 +0000 (14:33 +0100)]
vorbis_parser: add an AV prefix to VorbisParseContext

This is done in preparation for making it public.

4 years agovorbis_parser: use a dedicated AVClass for logging
Anton Khirnov [Wed, 29 Oct 2014 13:18:06 +0000 (14:18 +0100)]
vorbis_parser: use a dedicated AVClass for logging

Currently, the API takes an external AVCodecContext, which is used only
for extradata and logging. This change will allow to it to work without
an AVCodecContext in the following commits.

4 years agortmpproto: Ignore errors from the getStreamLength method
Martin Storsjö [Tue, 4 Nov 2014 07:23:35 +0000 (09:23 +0200)]
rtmpproto: Ignore errors from the getStreamLength method

It is never an error if this method failed. If rt->live was
explicitly set to 0 (known to be a recorded file), print it
as a warning, otherwise print it as a debug message.

Based on a patch by Michael Niedermayer.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agohwaccel: Deinitialize hardware acceleration early enough
Rémi Denis-Courmont [Wed, 29 Oct 2014 17:07:20 +0000 (19:07 +0200)]
hwaccel: Deinitialize hardware acceleration early enough

The application will destroy the underlying hardware handles when
get_format() gets called again. Also this ensures the
deinitialization takes place if the get_format callback returns an
error.

Regression from 1c80c9d7ef809180042257200c7b5f6b81d0b0e2.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agoaacdec: add default case in channel layout
Vittorio Giovara [Thu, 30 Oct 2014 00:52:01 +0000 (00:52 +0000)]
aacdec: add default case in channel layout

Bug-Id: CID 732291

4 years agoaacsbr: change order of operation to prevent out of array read
Michael Niedermayer [Thu, 30 Oct 2014 00:52:04 +0000 (00:52 +0000)]
aacsbr: change order of operation to prevent out of array read

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

4 years agoaacsbr: treat 1-d arrays as such
Vittorio Giovara [Thu, 30 Oct 2014 00:52:03 +0000 (00:52 +0000)]
aacsbr: treat 1-d arrays as such

CC: libav-stable@libav.org
Bug-Id: CID 1238802 / CID 1238793 / CID 1238785
        CID 1238808 / CID 1238809

4 years agocelp_filters: don't use filter lenght as loop bound
Vittorio Giovara [Thu, 30 Oct 2014 00:51:56 +0000 (00:51 +0000)]
celp_filters: don't use filter lenght as loop bound

CC: libav-stable@libav.org
Bug-Id: CID 717906 / CID 717907 / CID 717916 /
        CID 717917 / CID 717919 / CID 732259

4 years agoerror_resilience: initialize prev_* variables
Vittorio Giovara [Thu, 30 Oct 2014 00:51:57 +0000 (00:51 +0000)]
error_resilience: initialize prev_* variables

CC: libav-stable@libav.org
Bug-Id: CID 732293 / CID 732294

4 years agomotion_est: remove dead code
Vittorio Giovara [Thu, 30 Oct 2014 00:51:52 +0000 (00:51 +0000)]
motion_est: remove dead code

mb_type is initialized to 0 and never updated before the check.

Bug-Id: CID 1238782

4 years agoget_bits: remove unused assignment
Vittorio Giovara [Thu, 30 Oct 2014 00:51:51 +0000 (00:51 +0000)]
get_bits: remove unused assignment

Bug-Id: CID 1238816

4 years agomovenc: Define the flag bits using shifts instead of as decimal numbers
Martin Storsjö [Sun, 2 Nov 2014 15:01:10 +0000 (17:01 +0200)]
movenc: Define the flag bits using shifts instead of as decimal numbers

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Don't write any iso brands in ismv files
Martin Storsjö [Wed, 29 Oct 2014 20:55:23 +0000 (22:55 +0200)]
movenc: Don't write any iso brands in ismv files

We deviate slightly from the iso specs for these files.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Don't write any tfdt atom for ismv files
Martin Storsjö [Thu, 30 Oct 2014 07:35:10 +0000 (09:35 +0200)]
movenc: Don't write any tfdt atom for ismv files

The tfdt atom shouldn't be needed in those cases, we already
write tfxd atoms for ismv anyway, which is roughly equivalent.

This avoids having to declare the iso6 brand for ismv files.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Write a 0 duration in mdhd and tkhd for an empty initial moov
Martin Storsjö [Wed, 29 Oct 2014 20:51:29 +0000 (22:51 +0200)]
movenc: Write a 0 duration in mdhd and tkhd for an empty initial moov

ISO/IEC 14496-12:2012/Cor 1:2013 is explicit about how this should be
handled. All zeros doesn't mean that the full file has got a zero
duration, only that the track samples described within the initial moov
have got zero duration. An all ones duration means an indeterminate
duration.

Keep writing a duration consisting of all ones for the ISM mode -
older windows media player versions won't play a file if this is
zero. (Newer windows media player versions play either version fine.)

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Add a flag for using default-base-is-moof in tfhd atoms
Martin Storsjö [Wed, 29 Oct 2014 09:53:21 +0000 (11:53 +0200)]
movenc: Add a flag for using default-base-is-moof in tfhd atoms

Similarly to the omit_tfhd_offset flag added in e7bf085b, this
avoids writing absolute byte positions to the file, making them
more easily streamable.

This is a new feature from 14496-12:2012, so application support
isn't necessarily too widespread yet (support for it in libav was
added in 20f95f21f in July 2014).

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Signal iso6 in compatible_brands when using tfdt
Martin Storsjö [Wed, 29 Oct 2014 15:00:38 +0000 (17:00 +0200)]
movenc: Signal iso6 in compatible_brands when using tfdt

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodoc: Document the omit_tfhd_offset flag to the mp4 muxer
Martin Storsjö [Wed, 29 Oct 2014 13:30:22 +0000 (14:30 +0100)]
doc: Document the omit_tfhd_offset flag to the mp4 muxer

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Use a local variable consistently
Martin Storsjö [Tue, 21 Oct 2014 08:36:22 +0000 (11:36 +0300)]
movenc: Use a local variable consistently

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Don't check the custom IO flag when using faststart
Martin Storsjö [Tue, 21 Oct 2014 07:44:38 +0000 (10:44 +0300)]
movenc: Don't check the custom IO flag when using faststart

The custom IO flag actually never is set for muxers, only for
demuxers, so the check was pointless (unless a user intentionally
would set the flag to signal using custom IO).

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Don't use track_id to decide which track is the first in a moof
Martin Storsjö [Wed, 29 Oct 2014 07:20:51 +0000 (09:20 +0200)]
movenc: Don't use track_id to decide which track is the first in a moof

If one track doesn't have any samples within a moof, no traf/trun
is written for it. When the omit_tfhd_offset flag is set, none
of the tfhd atoms have any base_data_offset set, and the implicit
offset (end of previous track fragment data, or start of the moof
for the first trun) is used.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agobethsoftvid: simplify return handling
Vittorio Giovara [Wed, 29 Oct 2014 17:02:27 +0000 (17:02 +0000)]
bethsoftvid: simplify return handling

Fixes a double free in case of av_packet_new_side_data() failure.

4 years agoassdec: check av_new_packet return value
Vittorio Giovara [Fri, 24 Oct 2014 12:15:40 +0000 (13:15 +0100)]
assdec: check av_new_packet return value

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

4 years agojack: Use av_strerror
Luca Barbato [Sun, 26 Oct 2014 13:02:45 +0000 (14:02 +0100)]
jack: Use av_strerror

4 years agofbdev: Use av_strerror
Luca Barbato [Sun, 26 Oct 2014 13:02:44 +0000 (14:02 +0100)]
fbdev: Use av_strerror

4 years agomtv: improve header check and avoid division by zero
Vittorio Giovara [Fri, 24 Oct 2014 12:15:36 +0000 (13:15 +0100)]
mtv: improve header check and avoid division by zero

CC: libav-stable@libav.org
Bug-Id: CID 732203 / CID 732204

4 years agooggenc: remove unneeded null check
Michael Niedermayer [Fri, 24 Oct 2014 12:15:37 +0000 (13:15 +0100)]
oggenc: remove unneeded null check

The code would have segfaulted before if oggstream were NULL.

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

4 years agoconfigure: Check only for xcb
Luca Barbato [Tue, 28 Oct 2014 09:43:52 +0000 (10:43 +0100)]
configure: Check only for xcb

xcb-utils are not needed anymore.

4 years agolavd: fix building x11grab after a6674d2
Anton Khirnov [Tue, 28 Oct 2014 06:22:00 +0000 (07:22 +0100)]
lavd: fix building x11grab after a6674d2

4 years agovdpau: return MAIN instead of BASELINE for H.264 CBP
Rémi Denis-Courmont [Sun, 26 Oct 2014 19:33:58 +0000 (21:33 +0200)]
vdpau: return MAIN instead of BASELINE for H.264 CBP

This is the same as the previous change, but for applications using the
old API (such as VLC 2.2).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agovdpau/h264: request MAIN rather than BASELINE VDPAU profile for CBP
Rémi Denis-Courmont [Sun, 26 Oct 2014 19:24:12 +0000 (21:24 +0200)]
vdpau/h264: request MAIN rather than BASELINE VDPAU profile for CBP

The H.264 Constrained Baseline Profile (CBP) is a subset of both the
Main Profile and the Baseline Profile. In principles, a hardware
decoder that supports either of those can decode CBP content. As it
happens, Main is supported by all VDPAU drivers, and Baseline is not.

So favor map CBP to MP for now. Hopefully in the future libvdpau will
offer an explicit choice for CBP.

This fixes bug 757.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agomxfdec: reduce loop bound in mxf_read_pixel_layout()
Tomas Härdin [Mon, 27 Oct 2014 12:59:48 +0000 (13:59 +0100)]
mxfdec: reduce loop bound in mxf_read_pixel_layout()

Makes coverity less confused and code more readable.

Bug-Id: CID 732262

4 years agobethsoftvid: check return value and clean memory
Vittorio Giovara [Fri, 24 Oct 2014 12:15:34 +0000 (13:15 +0100)]
bethsoftvid: check return value and clean memory

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

4 years agofilmstripdec: avoid integer overflow
Vittorio Giovara [Fri, 24 Oct 2014 12:15:39 +0000 (13:15 +0100)]
filmstripdec: avoid integer overflow

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

4 years agomatroskaenc: write correct Display{Width, Height} in stereo encoding
Vittorio Giovara [Wed, 22 Oct 2014 13:36:32 +0000 (14:36 +0100)]
matroskaenc: write correct Display{Width, Height} in stereo encoding

should be the raw amount of pixels (for example 3840x1080 for full HD side by
side) and the DisplayWidth/Height in pixels should be the amount of pixels for
one plane (1920x1080 for that full HD stream)."

So, move the aspect ratio check in the mkv_write_stereo_mode() function
and always write the embl when stereo format and/or aspect ration is set.
Also add a few comments to that function.

CC: libav-stable@libav.org
Found-by: Asan Usipov <asan.usipov@gmail.com>
4 years agoxcbgrab: XCB-based screen capture
Luca Barbato [Sun, 24 Aug 2014 12:18:22 +0000 (14:18 +0200)]
xcbgrab: XCB-based screen capture

Matches the x11grab screen capture by features.

4 years agolavf: Implement ff_brktimegm using gmtime_r
Martin Storsjö [Fri, 24 Oct 2014 08:08:28 +0000 (11:08 +0300)]
lavf: Implement ff_brktimegm using gmtime_r

While a standalone implementation is nice, we already depend on
gmtime and gmtime_r in a number of places.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodrawtext: Remove the ifdef for localtime_r
Martin Storsjö [Fri, 24 Oct 2014 07:59:34 +0000 (10:59 +0300)]
drawtext: Remove the ifdef for localtime_r

If it isn't available in the system, we've got a fallback to
the normal localtime function, so normal code can assume it is
available as long as time_internal.h is included.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoUse gmtime_r instead of gmtime and localtime_r instead of localtime
Martin Storsjö [Fri, 24 Oct 2014 07:46:36 +0000 (10:46 +0300)]
Use gmtime_r instead of gmtime and localtime_r instead of localtime

gmtime isn't thread safe in general. In msvcrt (which lacks gmtime_r),
the buffer used by gmtime is thread specific though.

One call to localtime is left in avconv_opt.c, where thread safety
shouldn't matter (instead of making avconv depend on the libavutil
internal header).

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolavu: Provide fallbacks for gmtime_r and localtime_r
Martin Storsjö [Fri, 24 Oct 2014 07:33:19 +0000 (10:33 +0300)]
lavu: Provide fallbacks for gmtime_r and localtime_r

This allows writing most code as if they always are is available.

These are ok to use from other libraries even though it's not a
public header, since they only provide an inline declaration, and
doesn't add an actual dependency on lavu internals. (This can be
considered more a build system compatibility fallback than a
libavutil feature.)

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolavf: Check the return value of strftime
Martin Storsjö [Fri, 24 Oct 2014 07:43:20 +0000 (10:43 +0300)]
lavf: Check the return value of strftime

If the buffer provided to strftime is too small, the buffer contents
are indeterminate - it does not guarantee actually null terminating
the buffer.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agowtv: Avoid needlessly calling gmtime twice with the same argument
Martin Storsjö [Fri, 24 Oct 2014 07:36:54 +0000 (10:36 +0300)]
wtv: Avoid needlessly calling gmtime twice with the same argument

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomov: fix assigment check
Vittorio Giovara [Mon, 20 Oct 2014 13:11:25 +0000 (14:11 +0100)]
mov: fix assigment check

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

4 years agomxfenc: Fix possible integer overflows
Tomas Härdin [Thu, 23 Oct 2014 23:05:59 +0000 (00:05 +0100)]
mxfenc: Fix possible integer overflows

None of these are likely unless the user is writing a file with two billion
streams or a duration of around two months.

CC: libav-stable@libav.org
Bug-Id: CID 700568 / CID 700569 / CID 700570 /
        CID 700571 / CID 700572 / CID 700573

4 years agomxfdec: add missing break
Vittorio Giovara [Thu, 23 Oct 2014 23:05:57 +0000 (00:05 +0100)]
mxfdec: add missing break

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

4 years agomatroskaenc: check avio_open_dyn_buf return value
Vittorio Giovara [Thu, 23 Oct 2014 23:05:55 +0000 (00:05 +0100)]
matroskaenc: check avio_open_dyn_buf return value

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

4 years agomatroskadec: check return values
Vittorio Giovara [Thu, 23 Oct 2014 23:05:53 +0000 (00:05 +0100)]
matroskadec: check return values

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

4 years agomatroskadec: fix leak on error
Vittorio Giovara [Thu, 23 Oct 2014 23:05:52 +0000 (00:05 +0100)]
matroskadec: fix leak on error

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

4 years agolavf: replace rename() with ff_rename()
Luca Barbato [Sun, 19 Oct 2014 22:48:49 +0000 (00:48 +0200)]
lavf: replace rename() with ff_rename()

The new function wraps errno so that its value is correctly reported
when other functions overwrite it (eg. in case of logging).

CC: libav-stable@libav.org
Bug-Id: CID 1135748
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agoflac_picture: prevent a possible out of bound write
Vittorio Giovara [Mon, 20 Oct 2014 13:11:21 +0000 (14:11 +0100)]
flac_picture: prevent a possible out of bound write

At "mimetype[len] = 0;" mimetype is a 64 element array and len might be
equal to or greater than that.

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

4 years agoimg2dec: check av_new_packet return value
Vittorio Giovara [Mon, 20 Oct 2014 13:11:15 +0000 (14:11 +0100)]
img2dec: check av_new_packet return value

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

4 years agoaudiointerleave: check av_new_packet return value
Vittorio Giovara [Mon, 20 Oct 2014 13:11:14 +0000 (14:11 +0100)]
audiointerleave: check av_new_packet return value

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

4 years agoavfilter: check filter link validity
Vittorio Giovara [Mon, 20 Oct 2014 13:11:13 +0000 (14:11 +0100)]
avfilter: check filter link validity

Remove now redundant check.

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

4 years agomp3enc: write full LAME frame
Anton Khirnov [Sat, 12 Apr 2014 13:20:57 +0000 (15:20 +0200)]
mp3enc: write full LAME frame

Most importantly, it contains the encoder delay and replaygain info.

4 years agoavconv: copy stream-level side data when streamcopying
Anton Khirnov [Sat, 18 Oct 2014 16:19:55 +0000 (18:19 +0200)]
avconv: copy stream-level side data when streamcopying