10238 Commits

Author SHA1 Message Date
Michael Niedermayer
b89e5b138f avformat/utils: do not override pts in h264 when they are provided from the demuxer
Fixes Ticket2143

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1e5271a9fd6ddcceb083f2185a4bbd8d44c9a813)
2013-10-27 19:50:29 +01:00
Michael Niedermayer
43af9624fe avformat/mov: force parsing of headers if stts is absent
Fixes Ticket2991

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e41ea866fc26f38d770bbc1ad67703e7f4400ae1)
2013-10-24 11:41:01 +02:00
Michael Niedermayer
5df35d9a21 avformat/wavdec: Dont trust the fact chunk for PCM
Fixes Ticket3033

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 83fc6c822b06688e572333299927d93eb3c6c426)

Conflicts:
	libavformat/wav.c
(cherry picked from commit 89b5f5f494a2387541de8960839c2539a73a31fa)
2013-10-24 11:37:29 +02:00
Michael Niedermayer
d3ef17740d avformat/avidec: match first index and first packet size=0 handling
Fixes Ticket2861

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 227a0eb5a92409572f2cecde6137529b83e7d495)

Conflicts:
	libavformat/avidec.c
2013-08-31 09:38:15 +02:00
Michael Niedermayer
cbf7335940 matroska_read_seek: Fix used streams for subtitle index compensation
Might fix Ticket1907 (I have no testcase so i cant test)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4758e32a6c48044f77102a49110c79b4f338f648)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-26 21:58:56 +02:00
Michael Niedermayer
97f739ac9b avformat/matroskadec: check out_samplerate before using it in av_rescale()
Prevent assertion failure with damaged input

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 338f8b2eaf36f078eb5cc26ac10e651dc4c48243)
2013-08-25 23:35:10 -03:00
James Almer
c447047117 matroskadec: Improve TTA duration calculation
Calculate the duration as accurately as possible to improve decoding of samples
where the last frame is smaller than the rest.

Signed-off-by: James Almer <jamrial@gmail.com>
Approved-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit af248fa1174200acb537a6ab1198bb2fed38e884)

Conflicts:
	libavformat/matroskadec.c
2013-08-25 19:40:11 -03:00
Michael Niedermayer
11bc88eebd matroskaenc: simplify mkv_check_tag()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 066111bf19518a9f4d836991b34dbfc5ab72a41a)
2013-08-25 19:37:05 -03:00
James Almer
7d2e17fd2d lavf/matroskaenc: Check for valid metadata before creating tags
Tags must have at least one SimpleTag element to be spec conformant.
Updated lavf-mkv and seek-lavf-mkv FATE references as the tests were affected by
this.

Fixes ticket #2785

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 088ed5314694031e07e02e9d364c9d486a60e704)

Conflicts:
	tests/ref/lavf/mkv
	tests/ref/seek/lavf-mkv
2013-08-25 19:36:31 -03:00
Dale Curtis
c27f2ea471 avformat/utils: Keep internal and external av_read_frame() packets in sync.
Otherwise, during error conditions, the caller will be left with
dangling pointers to a destructed packet => boom.

BUG=242786
TEST=ffmpeg_regression_tests

Commit slightly simplified by commiter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c54a1565f512858ccfa70392f40f11c098bc1b63)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-24 15:17:48 +02:00
Michael Niedermayer
e452e4ca5c mmsh: dont close context on seeking failure
Fixes Ticket2581

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b4579a29c75e2968ede2ad002dd4a495dbfc883d)
2013-07-07 21:45:14 +02:00
Michael Niedermayer
ec882942ce avformat/mov: Fix duration of fragmented mov
Fixes Ticket2757

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dc2a13aa802fc691c25d5e0194818831058316ee)
2013-07-07 18:50:55 +02:00
Michael Niedermayer
cbbfdcf9ee mpegts: only reopen pmt_cb filter if its different from the previous.
Fixes Ticket2632

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b009267910df10c004b5f340a090d45da29089a0)
2013-07-07 18:50:02 +02:00
Michael Niedermayer
139005452d rmdec: Pass AVIOContext to rm_read_metadata()
Fix null pointer dereference
Fixes Ticket2588

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bf87908cd8da31e8f8fe75c06577170928ea70a8)

Conflicts:
	libavformat/rmdec.c
2013-07-07 18:49:33 +02:00
Michael Niedermayer
a1e4d1f933 avformat/libmodplug: Reduce the probe score for small input
This ensures that theres enough data for mpeg_probe() to recognize mpeg-ps
Fixes Ticket2583

Based on code by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c605adbf562fbf535e83ae427bb681bc45e440c8)
2013-06-21 01:17:10 +02:00
Carl Eugen Hoyos
3d4a61fbda Autodetect idcin only if audio properties allow decoding.
Fixes ticket #2688.
(cherry picked from commit 06bede95fcea47d2e51e8ff248c15311f335b898)
2013-06-19 23:47:43 +02:00
Michael Niedermayer
ba445be96f avienc: Disallow the first frame to be skiped
Fixes Ticket2386

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc0db8cf3042186d8355dcf10be67071cfbbcc5d)

Conflicts:
	libavformat/avienc.c
2013-05-28 09:36:01 +02:00
Michael Niedermayer
f7dbe180a0 avidec: dont randomly skip packets for offseting the index
Fixes Ticket2490

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6c593f1b671b7725b8c36f92f7c0a23ccf8e7628)
2013-05-17 22:56:00 +02:00
Carl Eugen Hoyos
048cd60dc3 Do not read strd chunk in avi files as H264 extradata.
Fixes ticket #2561.
(cherry picked from commit 231b3317184790b6be4b4619d96fd328f13aeabb)
2013-05-13 14:48:15 +02:00
Reimar Döffinger
d12294f447 matroska: set "done" only during resync fail.
Fixes playback of test7.mkv validation test file.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 762d4335aec2e5299a06bfbce15d21336af19464)
2013-05-07 10:55:19 +02:00
Paul B Mahol
708101c6f5 smacker: fix off by one error
Regression since a93b572ae4f517ce0c35cf085167c318e9215908.

Fixes #2426.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit e3cc92a623a6ece42816c7a692c8815688a99ab0)
2013-04-03 15:17:21 +02:00
Carl Eugen Hoyos
2a30d4309f Write broken aac frames to mov files instead of skipping them.
Fixes decoding with picky media players.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b448c0a68d0cc7dfef736267dfdaed0e213c020b)

Conflicts:
	libavformat/movenc.c
2013-04-02 12:52:49 +02:00
Carl Eugen Hoyos
8538811a1f Only test the first frame for missing aac_adtstoasc bistream filter.
Many players ignore broken aac frames, so don't abort mov or flv
muxing when encountering one, just print a warning instead.

Fixes ticket #2380.
(cherry picked from commit 1741fece7073f51efdd837a4f307ea2cdf3d1cfb)

Conflicts:
	libavformat/flvenc.c
2013-03-27 01:00:14 +01:00
Michael Niedermayer
faeb2b3e69 rmdec: flush audio packet on seeking
Fixes Ticket1605

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 519ebb5ee5b89b8ecc80b4a4540fcbeb65cda172)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-20 23:11:46 +01:00
Alexander Kojevnikov
7cb24ecd4c mp3dec: Fix VBR bit rate parsing
When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.

When parsing the stream, don't override the bit rate if it's already set,
otherwise calculate the mean bit rate from parsed frames. This way, the bit
rate will be set correctly both for CBR and VBR streams.

Signed-off-by: Alexander Kojevnikov <alexander@kojevnikov.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 29d8cd265a536063420afe78375b2176a9e1abc5)

Conflicts:

	tests/ref/lavf-fate/mp3

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-20 22:02:28 +01:00
Michael Niedermayer
b5469fec6a movenc: hotfix, dont store fiel for h264 / mpeg4-asp / dnxhd
Other software does not store it in this case, and the information
is provided by the codec stream

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 405cc0d9052079307b2b4188c396ae30c8e9108b)

Conflicts:

	tests/ref/lavf/mov
	tests/ref/seek/lavf_mov
	tests/ref/vsynth/vsynth1-dnxhd-1080i
	tests/ref/vsynth/vsynth1-mpeg4
	tests/ref/vsynth/vsynth2-dnxhd-1080i
	tests/ref/vsynth/vsynth2-mpeg4
2013-03-20 22:02:28 +01:00
Xi Wang
3fb1a6c702 rtmp: fix buffer overflows in ff_amf_tag_contents()
A negative `size' will bypass FFMIN().  In the subsequent memcpy() call,
`size' will be considered as a large positive value, leading to a buffer
overflow.

Change the type of `size' to unsigned int to avoid buffer overflow, and
simplify overflow checks accordingly.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4e692374f7962ea358c329de38c380103f8991b6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-20 22:02:28 +01:00
Xi Wang
dd64626022 rtmp: fix multiple broken overflow checks
Sanity checks like `data + size >= data_end || data + size < data' are
broken, because `data + size < data' assumes pointer overflow, which is
undefined behavior in C.  Many compilers such as gcc/clang optimize such
checks away.

Use `size < 0 || size >= data_end - data' instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 902cfe2f74d777a7dc20ac68f2393b9f84b790c1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-20 22:02:28 +01:00
Xi Wang
a31be9dd06 rtpenc: fix overflow checking in avc_mp4_find_startcode()
The check `start + res < start' is broken since pointer overflow is
undefined behavior in C.  Many compilers such as gcc/clang optimize
away this check.

Use `res > end - start' instead.  Also change `res' to unsigned int
to avoid signed left-shift overflow.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2f014567cfd63e58156f60666f1a61ba147276ab)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-20 22:02:28 +01:00
Carl Eugen Hoyos
4b03f2c522 Require at least three frames to autodetect loas.
(cherry picked from commit a60530e3ee1d9532c026a52b03661f88e163d647)
2013-03-02 02:05:07 +01:00
Nicolas George
a8b92c4b3c lavf/avio: check for : in filenames for protocols.
If the first "special" character in a filename is a comma,
it can introduce protocol options, but only if there is a
colon at the end. Otherwise, it is just a filename with a
comma.

Fix trac ticket #2303.
(cherry picked from commit d9fad53f4b447db1e436dcf3fc4a57e604616e6c)
2013-03-01 08:57:53 +01:00
Carl Eugen Hoyos
381e3e7e44 Revert "swfenc: use av_get_audio_frame_duration() instead of AVCodecContext.frame_size"
This reverts commit 620b88a302d522f71a6a95aff500cf7bd8520043.

Fixes ticket #2272.
2013-02-17 20:55:37 +01:00
Carl Eugen Hoyos
ec18baadfa Write the fiel atom to mov files independently of the used video coded.
The QuickTime specification does not contain any hint that the atom
must not be written in some cases and both the QuickTime and the
AVID decoders do not fail if the atom is present.

This change allows to signal (visually) interlaced streams with
a codec different from uncompressed video.

As a side-effect, this fixes ticket #2202
(cherry picked from commit 7d0e3b197c817b307d599a23704a44763ed0bbdd)

Conflicts:
	libavformat/movenc.c
	tests/ref/lavf/mov
	tests/ref/seek/lavf_mov
	tests/ref/vsynth/vsynth1-avui
	tests/ref/vsynth/vsynth1-dnxhd-1080i
	tests/ref/vsynth/vsynth1-mpeg4
	tests/ref/vsynth/vsynth2-avui
	tests/ref/vsynth/vsynth2-dnxhd-1080i
	tests/ref/vsynth/vsynth2-mpeg4
2013-02-14 15:43:15 +01:00
Peter Ross
155a0bed97 wtvdec: demux thumbnail picture to AVStream.attached_pic
Fixes ticket #2133.

(cherry picked from commit 508836932fcbc3c109fcc4df7a2f2b0bf21bbece)

Conflicts:
	libavformat/wtvdec.c
2013-01-30 10:00:38 +01:00
Carl Eugen Hoyos
ebb3a5974f matroskaenc: add codec_tag lists back.
This reverts 312645e :
"Do not set codec_tag property for matroska muxers."

Also adds dummy codec_tag lists with codecs
supported in mkv but not in wav / avi.

Fixes ticket #2169.
(cherry picked from commit df39c3ce385c02cbd8046298578ea7454c0a0f81)

Conflicts:
	libavformat/matroskaenc.c
2013-01-24 02:39:28 +01:00
Michael Niedermayer
16b0b75327 ff_get_audio_frame_size: try to fix wma in wav
Fixes Ticket1905, Ticket2114

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2713e43ac85245805db95048493dde121a20aee7)
2013-01-07 01:05:34 +01:00
Michael Niedermayer
bf19d4c6fa lavf: Fix codec id forcing with probed codecs
Fixes Ticket2088

(cherry picked from commit 341e40f1e1eeba1a2952c26363630596193e887b)
2013-01-02 02:38:11 +01:00
Michael Niedermayer
5502b073ec lavf: factor codec id forcing out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a7fbc7d7b7eabc74ceb1970a995c56043315e433)

Conflicts:
	libavformat/utils.c
2013-01-02 02:31:27 +01:00
Michael Niedermayer
6d16f5c3f9 avidec: try to support oddly muxed MMES stream
Fixes ticket1804

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be89693ddc5a8cdeaf3edf48fb584d6adca54de0)
2012-12-10 01:04:54 +01:00
Michael Niedermayer
28e609a84f riff: ignore ff_read_riff_info() failure.
Some files simply contain invalid info tags.
Fixes unrelated bug posted into Ticket1821

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 09456d0df13404f004ab3a341d9ac21b7e5e6d6d)
2012-12-10 00:46:22 +01:00
Michael Niedermayer
c6850d3862 riff: retry reading metadata without padding if it fails with
Fixes Ticket1821

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d0c27e88d2bb495d61bd32f41769f767a0c2a802)
2012-12-10 00:46:15 +01:00
Nicolas George
d3835cb877 lavf: compute probe buffer size more reliably.
The previous code computes the offset by reversing the growth
of the allocated buffer size: it is complex and did lead to
inconsistencies when the size limit is reached.

Fix trac ticket #1991.
(cherry picked from commit 03847eb8259291b4ff1bd840bd779d0699d71f96)

Conflicts:
	libavformat/utils.c
(cherry picked from commit e74cd2f4706f71da5e9205003c1d8263b54ed3fb)
2012-12-05 01:36:56 +01:00
Carl Eugen Hoyos
72791e41d4 Fix muxing mjpeg in swf.
(cherry picked from commit 7680d99b4302e476076cc1b8f2567f47c2aaef4d)
2012-09-13 09:21:26 +02:00
Reimar Döffinger
fb52da522c oggdec: Initialize stream index to -1 in ogg_packet.
The previous method of having to initialize it outside lead
to incorrect code: even if it was initialized, it usually was
only initialized once, thus a packet that could not be matched
to any stream would just be processed with the return values
from the previous call.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 69aeba1396d5a13e79cbc3cc9f49fd6896addb82)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-06 16:52:18 +02:00
Reimar Döffinger
5231a35559 oggdec: simplify start time calculation code.
Also slightly more correct behaviour in case streams_left for
some reason is 0 from the start.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit a4163b2d6583396845e06b1b976c3a981eb8cb1c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-06 16:52:09 +02:00
Michael Niedermayer
606538df6c oggdec: check stream index before using it in ogg_get_length()
Fixes crash based on a uninitialized array index read.
If the read does not crash then out of array writes based
on the same index might have been triggered afterwards.

Found-by: inferno@chromium.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9e1c55cfdec1e1e46fa39b92ea5c425ba9499c68)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-06 16:51:59 +02:00
Carl Eugen Hoyos
af3f7c88f2 Add missing CRLFs to avisynth error messages.
(cherry picked from commit 1faf0d6a7a70cb0bcfbbff0421fb00bb6da658f9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Carl Eugen Hoyos
b4294e2319 Fix MP2 muxer Makefile dependencies.
Found, analysed and tested by trac user Jamal.

Fixes ticket #1411
(cherry picked from commit 757d5b9bfda45e45d9ab28ad4d5a9205119fe549)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:26 +02:00
Michael Niedermayer
e863d3306f oggdec: fix regression that caused reading the whole file during open
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e0eaf1004910e451cbb8dbcb5c54ac63721adb61)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00
Michael Niedermayer
d0cb4dc471 lavf: use input keyframe flag when muxer does not provide keyframe flags.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5665674b55a45df757ed4fcd076a5cdf9ab484b6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-07 00:55:25 +02:00