ffmpeg.git
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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

5 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

5 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.

5 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()

5 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()

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

5 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

5 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.

5 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().

5 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().

5 years agoaarch64: Make the function pointer tables position independent
Martin Storsjö [Tue, 11 Nov 2014 22:00:04 +0000 (00:00 +0200)]
aarch64: Make the function pointer tables position independent

This allows running the code on android, where 64 bit binaries with
text relocations aren't allowed to be loaded.

Signed-off-by: Martin Storsjö <martin@martin.st>
5 years agoon2avc: Fix out of array access
Michael Niedermayer [Wed, 12 Nov 2014 10:13:01 +0000 (11:13 +0100)]
on2avc: Fix out of array access

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

5 years agodv: Drop a spurious check
Luca Barbato [Wed, 12 Nov 2014 18:10:39 +0000 (19:10 +0100)]
dv: Drop a spurious check

The buffer is always valid.

Bug-Id: CID 700682

5 years agoIcecast: Send content-type in all cases
Marvin Scholz [Tue, 11 Nov 2014 01:39:40 +0000 (02:39 +0100)]
Icecast: Send content-type in all cases

This is needed because Icecast since version 2.4.1 doesn't default
to audio/mpeg anymore. AVOption default not used here, since a later
check if -content_type is set is performed and would break.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
5 years agoIcecast: Send 100-continue header if possible
Marvin Scholz [Tue, 11 Nov 2014 01:39:39 +0000 (02:39 +0100)]
Icecast: Send 100-continue header if possible

This allows for proper error reporting. Only do
this for non-legacy requests as only Icecast >2.4.0
will reply with a proper status.
Libav seems to accept both, 100 and 200 status codes, but
let's stay close to spec.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
5 years agovf_interlace: Add SIMD for lowpass filter
Kieran Kunhya [Tue, 11 Nov 2014 18:43:42 +0000 (18:43 +0000)]
vf_interlace: Add SIMD for lowpass filter

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
5 years agoatrac3plus: always initialize refwaves
Vittorio Giovara [Wed, 12 Nov 2014 18:10:46 +0000 (19:10 +0100)]
atrac3plus: always initialize refwaves

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

5 years agolpc: always initialize ref and err
Vittorio Giovara [Wed, 12 Nov 2014 18:10:47 +0000 (19:10 +0100)]
lpc: always initialize ref and err

CC: libav-stable@libav.org
Bug-Id: CID 29585 / CID 700759

5 years agoexr: check return value
Vittorio Giovara [Wed, 12 Nov 2014 18:10:45 +0000 (19:10 +0100)]
exr: check return value

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

5 years agobgmc: fix sizeof arguments
Thilo Borgmann [Wed, 12 Nov 2014 18:10:43 +0000 (19:10 +0100)]
bgmc: fix sizeof arguments

CC: libav-devel@libav.org
Bug-Id: CID 608084 / CID 700724

5 years agoriff: support ProRes in avi (APCN fourcc)
Vittorio Giovara [Fri, 14 Nov 2014 13:39:18 +0000 (14:39 +0100)]
riff: support ProRes in avi (APCN fourcc)

5 years agojpeg2000: do not compute the same value twice
Vittorio Giovara [Wed, 12 Nov 2014 10:13:11 +0000 (11:13 +0100)]
jpeg2000: do not compute the same value twice

CC: libav-stable@libav.org
Bug-Id: CID 1026771 / CID 1026772 / CID 1026773

5 years agosvq1enc: check ff_get_buffer return value
Vittorio Giovara [Wed, 12 Nov 2014 10:13:07 +0000 (11:13 +0100)]
svq1enc: check ff_get_buffer return value

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

5 years agoansi: check ff_set_dimensions return value
Vittorio Giovara [Wed, 12 Nov 2014 10:13:06 +0000 (11:13 +0100)]
ansi: check ff_set_dimensions return value

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

5 years agoavs: check ff_set_dimensions return value
Vittorio Giovara [Wed, 12 Nov 2014 10:13:05 +0000 (11:13 +0100)]
avs: check ff_set_dimensions return value

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

5 years agog2meet: check ff_set_dimensions return value
Vittorio Giovara [Wed, 12 Nov 2014 10:13:04 +0000 (11:13 +0100)]
g2meet: check ff_set_dimensions return value

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

5 years agoindeo3: check ff_set_dimensions return value
Vittorio Giovara [Wed, 12 Nov 2014 10:13:02 +0000 (11:13 +0100)]
indeo3: check ff_set_dimensions return value

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

5 years agoshorten: check for return value
Vittorio Giovara [Tue, 11 Nov 2014 16:40:08 +0000 (17:40 +0100)]
shorten: check for return value

Avoid a possible negative bitshift.

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

5 years agodcadec: initialize variables before use
Vittorio Giovara [Wed, 12 Nov 2014 10:13:03 +0000 (11:13 +0100)]
dcadec: initialize variables before use

CC: libav-stable@libav.org
Bug-Id: CID 700751 / CID 700752

5 years agoescape124: explicitly set get_bits1 variable
Vittorio Giovara [Tue, 11 Nov 2014 16:40:09 +0000 (17:40 +0100)]
escape124: explicitly set get_bits1 variable

Makes coverity less confused.

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

5 years agomlpdec: check for negative index
Vittorio Giovara [Tue, 11 Nov 2014 16:40:06 +0000 (17:40 +0100)]
mlpdec: check for negative index

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

5 years agoffv1: fix out-of-bounds read
Vittorio Giovara [Tue, 11 Nov 2014 16:40:04 +0000 (17:40 +0100)]
ffv1: fix out-of-bounds read

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

5 years agovorbisenc: add missing parenthesis
Vittorio Giovara [Tue, 11 Nov 2014 16:40:03 +0000 (17:40 +0100)]
vorbisenc: add missing parenthesis

Bug-Id: CID 1238791

5 years agodpxenc: mention missing break
Vittorio Giovara [Tue, 11 Nov 2014 16:40:02 +0000 (17:40 +0100)]
dpxenc: mention missing break

Bug-Id: CID 732229

5 years agosunrastenc: mention missing break
Vittorio Giovara [Tue, 11 Nov 2014 16:40:01 +0000 (17:40 +0100)]
sunrastenc: mention missing break

Bug-Id: CID 732231

5 years agovc1dec: refactor check with missing parenthesis
Vittorio Giovara [Tue, 11 Nov 2014 16:40:00 +0000 (17:40 +0100)]
vc1dec: refactor check with missing parenthesis

FATE tests updated accordingly, no visual difference.

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

5 years agovc1dec: always initialize tx and ty
Vittorio Giovara [Tue, 11 Nov 2014 16:39:59 +0000 (17:39 +0100)]
vc1dec: always initialize tx and ty

CC: libav-stable@libav.org
Bug-Id: CID 1245702 / CID 1245703

5 years agodnxhdenc: check negative index
Vittorio Giovara [Tue, 11 Nov 2014 12:27:03 +0000 (13:27 +0100)]
dnxhdenc: check negative index

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

5 years agodisplay: fix order of operands
Vittorio Giovara [Tue, 11 Nov 2014 12:27:02 +0000 (13:27 +0100)]
display: fix order of operands

CC: libav-stable@libav.org
Bug-Id: CID 1238828 / CID 1238832

5 years agonellymoserenc: fix array index
Vittorio Giovara [Tue, 11 Nov 2014 12:26:57 +0000 (13:26 +0100)]
nellymoserenc: fix array index

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

5 years agonellymoserenc: fix array element ordering
Michael Niedermayer [Tue, 11 Nov 2014 12:26:56 +0000 (13:26 +0100)]
nellymoserenc: fix array element ordering

Fixes assertion failures and valgrind warnings in trellis encoder.

CC: libav-stable@libav.org
Bug-Id: CID 732256 / CID 732257

5 years agolibopusenc: prevent an out-of-bounds read by returning early
Vittorio Giovara [Tue, 11 Nov 2014 12:26:55 +0000 (13:26 +0100)]
libopusenc: prevent an out-of-bounds read by returning early

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

5 years agolibopusenc: check return value
Vittorio Giovara [Tue, 11 Nov 2014 12:26:54 +0000 (13:26 +0100)]
libopusenc: check return value

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

5 years agovp7: fix checking vp7_feature_value_size()
Michael Niedermayer [Tue, 11 Nov 2014 12:27:00 +0000 (13:27 +0100)]
vp7: fix checking vp7_feature_value_size()

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

5 years ago4xm: more thorought check for negative index and negative shift
Vittorio Giovara [Sun, 9 Nov 2014 07:48:41 +0000 (08:48 +0100)]
4xm: more thorought check for negative index and negative shift

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

5 years agotiff: Use av_mallocz_array
Luca Barbato [Sun, 9 Nov 2014 14:11:26 +0000 (15:11 +0100)]
tiff: Use av_mallocz_array

CC: libav-stable@libav.org
5 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.

5 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.

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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>
5 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>
5 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>
5 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>
5 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.

5 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>
5 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

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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

5 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>
5 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

5 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

5 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

5 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

5 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.

5 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

5 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.

5 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

5 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.

5 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.

5 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

5 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

5 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.