Commit Graph

8353 Commits

Author SHA1 Message Date
Alex Converse dc878b96a7 movenc: Support high sample rates in isomedia formats by setting the sample rate field in stsd to 0.
Libisomediafile appears to always set this field to zero.
2012-04-20 13:45:35 -07:00
Justin Ruggles b0e9edc44f avcodec: add a cook parser to get subpacket duration
Fixes jittery video playback of rm files with cook audio.
2012-04-20 12:11:20 -04:00
Mans Rullgard 6208313aeb avio: make AVIOContext.av_class pointer to const
Fix this warning:
libavformat/aviobuf.c:663:20: warning: assignment discards qualifiers from pointer target type

Although this is a public header, it should remain source and
binary compatible.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-18 23:54:20 +01:00
Mans Rullgard 9d72c0527c nutdec: add malloc check and fix const to non-const conversion warnings
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-18 23:54:20 +01:00
Mans Rullgard 3c58300269 matroska: do not set invalid default duration if frame rate is zero
If a video track specifies a zero frame rate (invalid but occurs),
this results in a division by zero and subsequent undefined conversion
to integer.  Setting the default duration from the frame rate only
if the latter is greater than zero avoids such problems.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-18 13:48:20 +01:00
Luca Barbato ac97d47d9b mkv: use av_reduce instead of av_d2q for framerate estimation
It avoids some rounding errors.
2012-04-17 16:37:42 -07:00
Luca Barbato 204bcdf56c mkv: report average framerate as minimal as well
This is in line with other demuxers and overall seems more correct
than assuming codec time base.
2012-04-17 15:47:22 -07:00
Justin Ruggles 8099fc763b riff: use bps instead of bits_per_coded_sample in the WAVEFORMATEXTENSIBLE header
This matches the value for the plain WAVEFORMATEX header.
Also fixes stream copy to WAVE for non-16-bit raw pcm.
2012-04-17 00:09:19 -04:00
Samuel Pitoiset b3b1751201 rtmp: Support 'rtmp_playpath', an option which overrides the stream identifier
This option is the stream identifier to play or to publish.
Sometimes the URL parser cannot determine the correct
playpath automatically, so it must be given explicitly
using this option (ie. -rtmp_playpath).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-16 23:11:58 +03:00
Samuel Pitoiset 6465562e13 rtmp: Support 'rtmp_app', an option which overrides the name of application
This option is the name of application to connect on the RTMP server.
Sometimes the URL parser cannot determine the app name automatically,
so it must be given explicitly using this option (ie. -rtmp_app).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-16 23:11:53 +03:00
Dale Curtis c788782c7d mov: free memory on header parsing failure
Call mov_read_close when mov_read_header fails.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-04-14 19:41:52 -07:00
Dale Curtis 4ebd422c04 mov: fix leaking memory with multiple drefs.
Instead of allocating over the original, free first. MOVStreamContext
is zero initialized so no double free will occur. Same style as other
fixes for the same problem in this file.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-04-14 19:41:52 -07:00
Yusuke Nakamura accea4d9d8 mov: Fix detecting there is no sync sample.
Stss atom without entries doesn't mean every sample is a sync sample.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-13 23:08:34 +03:00
Luca Barbato cbf767a87c avf: has_duration does not check the global one
Some container formats report a global duration, but not a per stream
one.
2012-04-13 12:03:16 -07:00
Dale Curtis 3116858853 matroska: Fix leaking memory allocated for laces.
During error conditions matroska_parse_block may exit without
freeing the memory allocated for laces.

Found via valgrind: http://pastebin.com/E54k8QFU

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-04-12 21:32:01 -07:00
Alex Converse 73b7437f1d movenc: Remove a dead initialization 2012-04-12 18:34:45 -07:00
Diego Biurrun 2ef15b46e4 avpacket, bfi, bgmc, rawenc: K&R prettyprinting cosmetics 2012-04-12 09:00:49 +02:00
Luca Barbato ebbede2265 movenc: small refactor mov_write_packet
Share the formerly internal write_packet with the hinter and move the
fragment flush logic to the user facing one since it is not concerned
about movtrack-only streams.

Fixes bug #263

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-11 14:38:37 +03:00
Luca Barbato 18b59956e0 movenc: remove redundant check
The proper check is already in mov_write_header.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-11 14:38:36 +03:00
Diego Biurrun 679481b3b6 Drop some pointless #ifdefs.
The files are only compiled if the #ifdef conditions are met.
2012-04-10 19:27:38 +02:00
Asen Lekov a559d65c07 nutdec: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-04-10 14:57:47 +02:00
Martin Storsjö 9294f538e9 rtsp: Don't use av_malloc(0) if there are no streams
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-08 15:51:33 +03:00
Martin Storsjö 62c3c8ca78 rtsp: Don't use uninitialized data if there are no streams
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-08 15:51:32 +03:00
Martin Storsjö 2ce7f4d4e6 cosmetics: Fix indentation
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-08 12:04:29 +03:00
Martin Storsjö 456001486e rtsp: Don't expose the MS-RTSP RTX data stream to the caller
This avoids exposing a dummy AVStream which won't get any data
and which will make avformat_find_stream_info wait for info about
this stream.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-08 12:04:22 +03:00
Martin Storsjö d293e3464d rtpdec_asf: Set the no_resync_search option for the chained asf demuxer
Searching for packet markers doesn't make sense for this use case,
where packets are fed one at a time to the demuxer.

This fixes playing back streams that have packets not starting
with the 0x82, 0x00, 0x00 marker.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-07 01:01:08 +03:00
Martin Storsjö 75b7feaeb4 asfdec: Add an option for not searching for the packet markers
Some streams don't contain these.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-07 01:01:03 +03:00
Joakim Plate ba24f12982 libavformat: Only require first packet to be known for audio/video streams
It can take a long time before subtitles or data streams show up,
so we shouldn't wait for those before assuming we have all info
for streams.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-06 20:51:18 +03:00
Martin Storsjö 20234a4bd7 cosmetics: Align muxer/demuxer declarations
Also add missing trailing commas, break long codec_tag lines and
add spaces in codec_tag declarations.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-06 19:19:59 +03:00
Raffaele Sena 34d908c083 rtmp: implement bandwidth notification
Improve compatibility with some servers.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-04-03 12:37:31 -07:00
Samuel Pitoiset faba4a9b88 rtmp: update supported audio codecs value
The audio codecs property is composed by all values except
SUPPORT_SND_INTEL (0x0008) and SUPPORT_SND_UNUSED (0x0010) which are
unused.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-04-03 12:24:33 -07:00
Anton Khirnov ddb4431208 id3v2: fix skipping extended header in id3v2.4
In v2.4, the length includes the length field itself.
2012-04-01 09:02:24 +02:00
Reimar Döffinger 10b1c060f9 oggenc: fix condition when not to flush due to keyframe granule.
The previous condition of 0 page size was wrong,
that would disable the mechanism for all frames at
a start of a page, thus some keyframes still would not
get their own granule.
The real problem is that header packets must not be flushed,
but they have (and must have) 0 granule and thus would
be detected as keyframes.
Add a separate parameter to mark header packets.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-03-30 16:32:16 -04:00
Andres Gonzalez ed3e1b485a oggenc: add pagesize option to set preferred page size
When set, if an Ogg stream buffer has enough data, a page is made
instead of filling maximum-size pages. Using smaller pages results
smaller seek intervals at the expense of higher container overhead.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-03-30 16:32:03 -04:00
Diego Biurrun afd8a3957b output-example: K&R formatting cosmetics, comment spelling fixes 2012-03-30 13:43:29 +02:00
Luca Barbato 93f6d0475f avf: make the example output the proper message
av_dump_format needs the codecs opened in order to print
them.
2012-03-29 17:07:19 -07:00
Luca Barbato 28db30aa29 avf: fix audio writing in the output-example
av_init_packet does not reset data and size fields in AVPacket,
avcodec_encode_audio2 can use preallocated AVPacket.
2012-03-29 17:07:19 -07:00
Ronald S. Bultje 4f7c7624c0 mov: don't overwrite existing indexes.
Prevents all kind of badness if files contain multiple
indexes.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-29 11:36:14 -07:00
Kostya Shishkov f704eb612b id3v2: add another mimetype for JPEG image 2012-03-29 15:49:06 +02:00
Ronald S. Bultje 44257ef426 asf: only set index_read if the index contained entries.
This allows falling back to a binary search if the file contains no
index, thus fixing seeking in such files (e.g. luckynight.wma).
2012-03-28 10:22:25 -07:00
Diego Biurrun a92be9b856 Replace memset(0) by zero initializations.
Also remove one pointless zero initialization in rangecoder.c.
2012-03-28 09:38:33 +02:00
Justin Ruggles eed691f7d1 oggdec: calculate correct timestamps in Ogg/FLAC
We need to parse the individual packet durations when there is more than one
packet in a page.
2012-03-27 16:11:06 -04:00
Paul B Mahol 55abaa58e5 westwood_vqa: fix SND0 chunk handling
Version from vqa header does not dictate which sound chunks may
appear in file.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-03-27 11:58:15 -04:00
Paul B Mahol f0a343f399 westwood_vqa: set video stream duration
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-03-27 08:54:07 -07:00
Jindrich Makovicka 904100e5fc make av_interleaved_write_frame() flush packets when pkt is NULL
This patch allows the user to force flushing of all queued packets
by calling av_interleaved_write_frame() with pkt set to NULL.

Signed-off-by: Jindrich Makovicka <jindrich.makovicka@nangu.tv>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-27 11:12:55 +03:00
Alex Converse c9024a9fd7 mpegts: Fix dead error checks 2012-03-26 17:53:51 -07:00
Diego Biurrun ad0e31f134 build: prettyprinting cosmetics 2012-03-26 13:00:10 +02:00
Anton Khirnov 967923abd1 lavf doxy: expand AVStream.codec doxy. 2012-03-26 10:59:43 +02:00
Anton Khirnov e44ada129c lavf doxy: improve AVStream.time_base doxy.
Remove confusing sentence that implied the user should set the timebase.
Elaborate on how the timebase is set for muxing.
2012-03-26 10:59:43 +02:00
Anton Khirnov f58b8cc3e3 lavf doxy: add some basic documentation about reading from the demuxer. 2012-03-26 10:59:43 +02:00