Commit Graph

8719 Commits

Author SHA1 Message Date
Jordi Ortiz 58f3e09ee4 tcp: Set AI_PASSIVE when the socket will be used for listening
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-27 14:04:02 +03:00
Anton Khirnov ce0a975689 mpc8: read APE tags. 2012-06-26 19:05:24 +02:00
Ronald S. Bultje 4b1b1449d9 network: Don't redefine error codes if they already exist in errno.h
Since the errno.h values don't match the error codes that winsock
returns, map the winsock error codes to the errno ones, to make
sure explicit checks against AVERROR(x) match.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-26 17:22:21 +03:00
Ronald S. Bultje e64bceeac0 configure: Check for sys/time.h
Apparently this include is needed on some systems for building the
poll fallback (for the timeval struct for select?), but it isn't
available on all systems. Thus only include it if it exists.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-26 17:22:21 +03:00
Martin Storsjö 39dba5aa1b network: Include unistd.h from network.h
This heaader is required for close() for sockets in network
code. For winsock, the equivalent function is defined in the
winsock2.h header.

This avoids having the HAVE_UNISTD_H in all files dealing with
raw sockets.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-26 17:22:21 +03:00
Carl Eugen Hoyos fbcaceb1ff mov: do not try to read total disc/track number if data atom is too short.
Fixes bug 308.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-06-26 13:12:50 +02:00
Martin Storsjö dc53858063 wtv: Check the return value from gmtime
On MSVC, gmtime returns NULL for values outside of their supported
range (and these show up in our fate test). This doesn't seem
to affect the actual fate test result.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-25 16:20:08 +03:00
Anton Khirnov 980e65f119 ape: create audio stream before reading tags.
Tags may contain attached picture, which will be exported as video
streams.

This ensures that the audio stream is always the first.
2012-06-24 07:55:33 +02:00
Anton Khirnov a7b8ff94b1 mov: make a length variable larger.
Right now, it's uint16_t, but for itunes metadata a 32bit number is
stored in it.
2012-06-24 07:54:29 +02:00
Mashiat Sarker Shakkhar f57d2f587b image2: Add "start_number" private option to the demuxer
Currently if a pattern is given we look for up to the fifth file name in
the sequence. This option sets that limit to an arbitrary number.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-06-24 07:37:38 +02:00
Mashiat Sarker Shakkhar b5bce20cc3 image2: Add "start_number" private option to the muxer
This adds the capability to start counting file number from an arbitrary
integer.

This includes a few lines of trivial code from FFmpeg codebase.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-06-24 07:35:54 +02:00
Mans Rullgard 896bb0d742 Replace usleep() calls with av_usleep()
This reduces the dependency on unistd.h which is not available
on all systems.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-22 17:15:36 +01:00
Mans Rullgard c19e0ebe53 lavf: include libavutil/time.h instead of redeclaring av_gettime()
This avoids some warnings about redundant declarations.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-21 22:53:05 +01:00
Ronald S. Bultje 67ffcb9613 lavf: Make codec_tag arrays constant
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-21 16:11:29 +03:00
Mans Rullgard dc7e336cae lavf, lavu: version bumps and APIchanges for av_gettime() move
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-21 11:45:28 +01:00
Kostya Shishkov 005c80b645 MS Screen 1 decoder 2012-06-20 19:08:10 +02:00
Mans Rullgard ae0a301668 Move av_gettime() to libavutil
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-20 17:09:03 +01:00
Ronald S. Bultje f1f37c7011 mov: fix operator precedence bug 2012-06-20 15:37:01 +01:00
Mans Rullgard 6501dcfb5e Remove unnecessary inclusions of [sys/]time.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-20 11:46:46 +01:00
Mans Rullgard 4e5a514813 lavf: remove unnecessary inclusions of unistd.h
These files do not use anything provided by unistd.h.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-20 11:46:30 +01:00
Martin Storsjö 042b272a4a udp: Properly check for invalid sockets
If stdin has been closed, 0 is a valid socket descriptor.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-19 20:25:09 +03:00
Martin Storsjö bb6c1abb0e tcp: Check the return value from getsockopt
Make sure we actually have an error code in ret, in case
getsockopt failed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-19 20:25:07 +03:00
Martin Storsjö a840cdda6c network: Use av_strerror for getting error messages
Also use ff_neterrno() instead of errno directly (which doesn't work
on windows), for getting the error code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-19 20:24:55 +03:00
Martin Storsjö 860b40f1f2 udp: Properly print error from getnameinfo
getnameinfo doesn't set errno on failure, it returns an error code,
which should be handled by gai_strerror instead of the normal
strerror.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-19 20:24:33 +03:00
Martin Storsjö 6aa4e88106 mmst: Use AVUNERROR() to convert error codes to the right range for strerror
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-19 20:23:19 +03:00
Martin Storsjö 561687696f network: Pass pointers of the right type to get/setsockopt/ioctlsocket on windows
This avoids warnings.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-19 20:22:47 +03:00
Samuel Pitoiset 9d811fd80f rtmp: Reduce the number of idle posts sent by sleeping 50ms
Rtmpt is effectively half duplex - the server can't return any
data unless we send a request (to which the server responds). If
we don't have any data to send currently, and the server didn't
return any data either, wait a little before doing the next request.

This avoids busy looping with idle posts with empty replies, while
waiting for more data from the server.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-19 20:21:21 +03:00
Ronald S. Bultje 8703f0140f flvdec: remove incomplete, disabled seeking code 2012-06-19 01:02:10 +01:00
Ronald S. Bultje 51a2b5546b http: replace atoll() with strtoll() 2012-06-19 01:00:13 +01:00
Ronald S. Bultje ae2bb52cd2 mpegts: remove unused/incomplete/broken seeking code 2012-06-19 00:56:43 +01:00
Martin Storsjö 579fd87b46 rtpenc: Support packetizing iLBC
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-18 22:01:04 +03:00
Martin Storsjö 89c3960544 rtpdec: Add a depacketizer for iLBC
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-18 22:01:04 +03:00
Martin Storsjö a2b251a05e Implement the iLBC storage file format
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-18 22:01:02 +03:00
Martin Storsjö 9e74db6850 mov: Support muxing/demuxing iLBC
The packet size, signalled via block_align, has to be passed via
the container.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-18 22:00:35 +03:00
Samuel Pitoiset 46743a859c rtmp: Don't send every flv packet in a separate HTTP request in RTMPT
Add a new option 'rtmp_flush_interval' that allows specifying the
number of packets to write before sending it off as a HTTP request.

This is mostly relevant for RTMPT - for plain RTMP, it only controls
how often we check the socket for incoming packets, which shouldn't
affect the performance in any noticeable way.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-18 22:00:31 +03:00
Martin Storsjö bbc8038614 rtsp: Send mode=record instead of mode=receive
This seems to be the correct mode to send, according to the
original RTSP RFC, and matches the method RECORD which is
sent later when starting to send data.

Darwin Streaming Server works fine with either of them.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-18 21:35:28 +03:00
Martin Storsjö d77f4afa98 rtpenc: Allow requesting H264 RTP packetization mode 0
This requires all NAL units to fit within single RTP packets. It
doesn't change the actual packetization for packets that fit, but
errors out and gives a helpful hint if the NAL units would have to
be split, and signals the right packetization mode in the SDP.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-18 12:27:56 +03:00
Samuel Pitoiset 8e50c57dcb RTMPT protocol support
This adds two protocols, but one of them is an internal implementation
detail just used as an abstraction layer/generalization in the code. The
RTMPT protocol implementation uses rtmphttp:// as an alternative to the
tcp:// protocol. This allows moving most of the lower level logic out
from the higher level generic rtmp code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-17 22:56:56 +03:00
Martin Storsjö 35127bf156 http: Properly handle chunked transfer-encoding for replies to post data
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-17 22:56:56 +03:00
Martin Storsjö eb564b23a3 http: Fail reading if the connection has gone away
This can happen if doing a new request using the same socket,
but the new request failed, which clears the urlcontext.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-17 22:56:51 +03:00
Martin Storsjö eb3918c1fd amr: Mark an array const
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-17 22:50:06 +03:00
Martin Storsjö 634e874de5 amr: More space cleanup
This was missed in the previous cleanup patch.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-17 22:50:04 +03:00
Martin Storsjö e9ef88fbd2 rtpenc: Fix memory leaks in the muxer open function
Also return a proper error code in these cases.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-17 22:49:25 +03:00
Martin Storsjö 5f26d4d448 amr: Cosmetic cleanup
Add spaces around operators, fix brace placement and whitespace to
match K&R style, vertically align code, remove redundant != 0 and
convert x == 0 into !x, drop useless braces.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-17 19:04:46 +03:00
Martin Storsjö 44fdf37c94 mov_chan: Fix operator precedence by adding parentheses
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-17 17:51:50 +03:00
Jordi Ortiz a7cc78cb11 tcp: Check the listen call
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-17 13:22:36 +03:00
Anton Khirnov ae702edf43 flacdec: read attached pictures. 2012-06-16 17:10:23 +02:00
Anton Khirnov a5db8e4a1a lavf: don't segfault when a NULL filename is passed to avformat_open_input()
This can easily happen when the caller is using a custom AVIOContext.

Behave as if the filename was an empty string in this case.

CC: libav-stable@libav.org
2012-06-16 17:09:33 +02:00
Janne Grunau 1cdcf043ca segment: remove unnecessary <strings.h> include 2012-06-15 19:10:58 +02:00
Samuel Pitoiset 7dc747f50b rtmp: Read and handle incoming packets while writing data
This makes sure all incoming packets are read and handled (and reacted
to) while sending an FLV stream over RTMP to a server. If there were
enough incoming data to fill the TCP buffers, this could potentially
make things block at unexpected places. For the upcoming RTMPT support,
we need to consume all incoming data before we can send the next
request.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-14 22:22:58 +03:00
Martin Storsjö d1beee0701 rtpdec: Don't require frames to start with a Mode A packet
While there is no reason for starting a frame with anything else
than a Mode A packet, some senders seem to consistently use Mode B
packets for everything. This fixes depacketization of such streams.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-14 22:11:43 +03:00
Samuel Pitoiset 8517e9c476 rtmp: Add a new option 'rtmp_buffer', for setting the client buffer time
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-13 17:04:39 +03:00
Samuel Pitoiset 9477c035a7 rtmp: Set the client buffer time to 3s instead of 0.26s
This factorizes existing code into a new function gen_buffer_time(),
which generates the client buffer time message and sends it to the
server.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-13 16:53:32 +03:00
Samuel Pitoiset c2d38beab2 rtmp: Handle server bandwidth packets
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-13 16:52:52 +03:00
Samuel Pitoiset 9ff930aace rtmp: Display a verbose message when an unknown packet type is received
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-13 16:52:31 +03:00
Martin Storsjö 0533868642 rtmp: Tokenize the AMF connection parameters manually instead of using strtok_r
This fixes builds on platforms without strtok_r (windows).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-13 11:36:47 +03:00
Samuel Pitoiset 0a9a225733 rtmp: Fix a possible access to invalid memory location when the playpath is too short.
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-12 14:33:57 +03:00
Samuel Pitoiset f862537de8 rtmp: Do not send extension for flv files
This fixes bugzilla bug #304.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-11 13:48:39 +03:00
Samuel Pitoiset 8ee3e1874e rtmp: support connection parameters
Allow using connection parameters in order to append arbitrary
AMF data like "B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0" to the
Connect message. You can pass these parameters through the -rtmp_conn
option.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-11 13:46:50 +03:00
Mans Rullgard 8aa93e9004 mov: set AVCodecContext.width/height for h264
This is required for correct cropping of files from Canon
cameras.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-09 15:08:51 +01:00
Alex Converse a8656cd425 mpegts: Remove disabled extension matching probe. 2012-06-07 12:27:04 -07:00
Alex Converse f0ff9eb493 avformat: Probe codecs at score 0 on buffer exhaustion conditions. 2012-06-05 09:51:51 -07:00
Alex Converse 62bebf6edb avformat: Factorize codec probing. 2012-06-05 09:51:51 -07:00
Kostya Shishkov c6061443f7 Indeo Audio decoder 2012-06-05 18:30:54 +02:00
Alex Converse 41e9682af2 movenc: Write chan atom for all audio tracks in mov mode movies. 2012-06-04 10:08:31 -07:00
Jindřich Makovička 84e430dd7b mpegtsenc: use avio_open_dyn_buf(), zero pointers after freeing
Per suggestion by Michael Niedermayer.

Signed-off-by: Jindřich Makovička <makovick@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-04 15:41:09 +03:00
Anton Khirnov a982e5a031 avidec: make scale and rate unsigned.
The specs say they are unsigned 32bit integers.
2012-06-04 14:18:49 +02:00
Anton Khirnov 19dfbf1915 librtmp: return AVERROR_UNKNOWN instead of -1. 2012-06-03 15:46:27 +02:00
Anton Khirnov a91943bcef librtmp: don't abuse a variable for two unrelated things. 2012-06-03 15:46:16 +02:00
Anton Khirnov 007aedeebf librtmp: add rtmp_app and rtmp_playpath private options.
This makes it easier to switch between native rtmp and librtmp.
2012-06-03 15:45:55 +02:00
Luca Barbato 21e2dc9fb7 flv: support stream text data as onTextData
Adobe specifies onTextData as the standard message to use to deliver
text information.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-06-03 03:36:01 +02:00
Jindrich Makovicka 2439bd8681 mpegtsenc: Support LATM packetization for AAC
This adds the avoption mpegts_flags and converts the existing
resend_headers option into a flag, keeping the old option as
fallback for now.

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-03 01:20:41 +03:00
Jindrich Makovicka 485d3ea064 adtsenc: Don't expose the muxer internals to the rest of lavf
This isn't required any longer, when the mpegts muxer uses it
as a proper chained muxer.

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-03 01:18:11 +03:00
Jindrich Makovicka b1c56eabe8 mpegtsenc: use AVFormatContext for AAC packetization
This removes the dependency on adts.c internals, and simplifies
adding other packetization formats.

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-03 01:17:48 +03:00
Jindrich Makovicka d1a3a3d4b2 mpegtsenc: use AVERROR() for return codes
Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-03 01:13:35 +03:00
Martin Storsjö dbaf79c9d7 http: Add the url_shutdown function for https, too
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-01 18:38:31 +03:00
Martin Storsjö 5952564185 http: Simplify code by removing a local variable
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-01 18:38:29 +03:00
Martin Storsjö 3cbcfa2dec http: Clear the old URLContext pointer when closed
This fixes issues with opening http urls that have authentication
or redirects, introduced in commit e999b641.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-01 18:38:28 +03:00
Martin Storsjö b7c3772be8 tcp: Try enabling SO_REUSEADDR when listening
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-01 01:56:22 +03:00
Martin Storsjö 641f4a885f tcp: Check the return values from bind and accept
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-01 01:56:21 +03:00
Oka Motofumi 5c742005fb avisynth: Make sure the filename passed to avisynth is in the right code page
avisynth is a non-unicode application and cannot accept UTF-8
characters. Therefore, the input filename should be converted to
the correct code page that it expects.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-31 22:39:08 +03:00
Samuel Pitoiset 9613240f72 http: Pass the proper return code of net IO operations
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-30 23:46:51 +03:00
Samuel Pitoiset 1876e7c0c2 http: Add 'post_data', a new option which sets custom HTTP post data
This allows doing http posts with a content-length header sent
in advance, avoiding chunked encoding.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-30 23:41:05 +03:00
Ronald S. Bultje 64bde80563 mp3/ac3 probe: search for PES headers to prevent probing MPEG-PS as MP3. 2012-05-30 09:08:29 -07:00
Samuel Pitoiset e999b641df http: Add support for reusing the http socket for subsequent requests
Introduce ff_http_do_new_request(), a new function which sends a new
HTTP request, reusing the existing connection to the server.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-28 16:42:40 +03:00
Samuel Pitoiset 3bdb438e65 http: Add support for using persistent connections
Add a new AVOption 'multiple_requests', which indicates if we want
to use persistent connections (ie. Connection: keep-alive).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-28 16:42:14 +03:00
Martin Storsjö 6099543ad4 rtsp: Check for dynamic payload handlers if no static payload mapping was found
Some systems abuse the static payload types 35 or 36 (which
according to IANA are unassigned) for H264.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-26 21:58:18 +03:00
Martin Storsjö 68c813081b rtpenc_chain: Return an error code instead of just a plain pointer
Also check the return value in sapenc.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-26 13:35:44 +03:00
Martin Storsjö 93cef6f923 rtpenc_chain: Free the URLContext on failure
If an URLContext is passed in, its ownership is given to this
function, and is either owned by the returned AVFormatContext
on a successful return, or freed on failure.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-26 13:35:44 +03:00
Martin Storsjö 2dcb21a95d rtpenc: Expose the ssrc as an avoption
This allows the caller to set it, and allows the caller to query
what it was set to.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-26 13:35:39 +03:00
Martin Storsjö 39e29aa019 cosmetics: Fix indentation
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-26 00:34:20 +03:00
Luca Barbato c6eeb9b7b6 rtmp: fix url parsing
The application component can have a subcomponent to specify the
application instance even if it doesn't have a ":" in the playpath.
2012-05-25 14:20:34 -07:00
Alex Converse ed7bdd8647 movenc: Don't write the 'wave' atom or its child 'enda' for lpcm audio.
It's left over from stsd v0. QuickTime 7 no longer writes 'wave' or 'enda'
when 'lpcm' is the audio tag.
2012-05-25 11:24:43 -07:00
Samuel Pitoiset 177bcc9593 rtmp: Pass the proper return code in rtmp_handshake
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-24 22:16:46 +03:00
Samuel Pitoiset bba287fdac rtmp: Check return codes of net IO operations
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-24 22:16:46 +03:00
Samuel Pitoiset a4d3f3580b rtmp: Return a proper error code instead of -1
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-24 00:25:36 +03:00
Samuel Pitoiset 08e93f5b46 rtmp: Check malloc calls
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-24 00:25:35 +03:00
Samuel Pitoiset f645f1d6ea rtmp: Check ff_rtmp_packet_create calls
Check malloc calls used by ff_rtmp_packet_create, unify error
handling and pass on error codes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-24 00:25:35 +03:00
Martin Storsjö 1e8561e369 flvdec: Make sure sample_rate is set to the updated value
The sample_rate variable is used for checks for audio format
changes at the end of the function.

This fixes cases where the sample rate was set from the codec
id by flv_set_audio_codec (as for nellymoser 8 kHz/16 kHz),
so the value set to last_sample_rate wasn't equal to sample_rate
at this point. This caused the demuxer otherwise reports a spurious
change to 5512 Hz and back to the correct one.

Updating channels in the same way is only done for consistency.
Currently, flv_set_audio_codec doesn't update that value.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-23 22:23:43 +03:00
Dave Yeo 3f9d6e4239 os_support: Define SHUT_RD, SHUT_WR and SHUT_RDWR on OS/2
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-23 10:38:14 +03:00
Samuel Pitoiset e5773d8bc3 http: Add support for reading http POST reply headers
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-22 23:16:46 +03:00
Samuel Pitoiset ba354a8cc0 http: Add http_shutdown() for ending writing of posts
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-22 23:16:44 +03:00
Samuel Pitoiset 4a9ca93556 tcp: Allow signalling end of reading/writing
tcp_shutdown() isn't needed at the moment, but is added for
consistency to explain how the function is supposed to be used.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-22 23:16:42 +03:00
Samuel Pitoiset 32d545e0a4 avio: Add a function for signalling end of reading/writing
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-22 23:16:41 +03:00
Diego Biurrun db9e00f469 Remove libnut wrapper
libnut is unmaintained and known to be buggy; native NUT code exists.
2012-05-21 08:51:50 +02:00
James Zern e9cef89702 avformat: Add a flag to mark muxers that allow (non strict) monotone timestamps.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-05-20 19:50:32 -04:00
Samuel Pitoiset 5d603f1b65 http: Factorize the code by adding http_read_header()
This function is used for reading http reply headers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-20 20:20:50 +03:00
Mans Rullgard 68aef0b481 lavf: change some (de)muxer names to lowercase
This is consistent with other format names.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-19 19:44:16 +01:00
Mans Rullgard 81ad97eeda lavf: make output format matching case insensitive
This is consistent with how input formats are matched.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-19 19:44:15 +01:00
Anton Khirnov 755cd4197d mov: enable parsing for VC-1.
This makes lavf discard broken timestamps for non-B frames in
samples/isom/vc1-wmapro.ism.
2012-05-18 19:38:21 +02:00
Martin Storsjö 4b7304e80d rtmp: Don't assume path points to a string of nonzero length
If using the new -rtmp_app and -rtmp_playpath parameters,
one can in many cases set the main url to just rtmp://server/.
If the trailing slash is omitted, path is a string of zero length,
and using path+1 will end up reading uninitialized data.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-17 21:16:52 +03:00
Mans Rullgard db465be45d lavf: add mdec to is_intra_only() list
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-15 15:49:56 +01:00
Mans Rullgard 7c6d240665 mtv: do not byteswap raw video in demuxer
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-14 20:26:39 +01:00
Diego Biurrun 70be4dddc8 gxfenc: remove disabled half-implemented MJPEG tag 2012-05-14 15:38:42 +02:00
Samuel Pitoiset d55961fa82 rtmp: Implement check bandwidth notification.
According to the behaviour of librtmp, it is recommended to send this
message to the server after receiving the 'onBWDone' callback in order
to do bandwidth checking and improve compatibility with some servers.
2012-05-10 13:55:32 +03:00
Samuel Pitoiset 05945db9ce rtmp: Support 'rtmp_swfurl', an option which specifies the URL of the SWF player. 2012-05-10 13:55:31 +03:00
Samuel Pitoiset e64673e4f4 rtmp: Support 'rtmp_flashver', an option which overrides the version of the Flash plugin. 2012-05-10 13:55:30 +03:00
Samuel Pitoiset 55c9320e06 rtmp: Support 'rtmp_tcurl', an option which overrides the URL of the target stream.
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-10 13:55:26 +03:00
Sean McGovern ded69c5e21 sctp: be consistent with socket option level
Replace SOL_SCTP by the more portable IPPROTO_SCTP.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-05-10 00:01:45 +02:00
Diego Biurrun 59cbc4eee2 mov: make one comment slightly more specific 2012-05-09 23:12:37 +02:00
Luca Barbato 5699884c2e sctp: Initial tcp-alike sctp support with streams
Signed-off-by: Jordi Ortiz <nenjordi@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-05-08 16:06:49 -07:00
Alex Converse 40f81769ae options_table: Add some missing #includes to fix "make checkheaders".
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-05-08 20:05:20 +02:00
Jordi Ortiz fcd0298c05 rtsp: Add content-type message header parsing
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-05-08 10:18:35 -07:00
Samuel Pitoiset b2e495afa8 rtmp: Support 'rtmp_live', an option which specifies if the media is a live stream.
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-08 13:21:35 +03:00
Diego Biurrun 520c1ec699 dv: Split profile handling code into a separate file. 2012-05-07 23:59:49 +02:00
Anton Khirnov 0a3ad7ff80 flvenc: use AVFormatContext, not AVCodecContext for logging.
Encoder tag being used for muxer messages is confusing.
2012-05-07 21:28:40 +02:00
Diego Biurrun 455245ca8a mov: Remove write-only variable in mov_read_chan().
libavformat/mov.c:597:25: warning: variable ‘cflags’ set but not used
2012-05-07 20:31:23 +02:00
Anton Khirnov 1432c1c429 lavf: add missing '*' in a doxy. 2012-05-07 14:22:42 +02:00
Diego Biurrun 9eb83a56aa build: cosmetics: Split HEADERS/OBJS/PROGS lists into one entry per line. 2012-05-07 14:01:32 +02:00
Diego Biurrun 30b1961c66 Mark a number of variables only used in av_dlog() calls as av_unused.
This fixes a number of unused-but-set gcc warnings.
2012-05-06 18:01:31 +02:00
Janne Grunau 29d27b5425 mpegmux: add stuffing to avoid incomplete PCM frames
Fixes https://bugzilla.libav.org/show_bug.cgi?id=244
2012-05-06 13:18:38 +02:00
Mans Rullgard ddce7dabd2 rtsp: avoid const warnings from strtol() call
The strtol() interface makes it difficult to use with
const-qualified pointers.  With this change, although
the const is still lost, the compiler does not warn
about it.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-06 12:04:25 +01:00
Martin Storsjö 2ed503af9f rtpdec_h264: Add missing newlines to av_log calls
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 22:11:49 +03:00
Martin Storsjö b97d21e4d6 rtpdec_h264: Free old extradata before clearing the pointer
This avoids memory leaks if there actually was some extradata
set before.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 22:11:45 +03:00
Martin Storsjö 3c148703f6 rtpdec_h264: Reorder code blocks
This removes one level of indentation.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 20:41:37 +03:00
Martin Storsjö b368861747 rtpdec_h264: Make start_sequence a static const array
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 20:35:33 +03:00
Martin Storsjö 48666c2bd6 rtpdec_h264: Cleanup debug packet type counting
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 20:35:05 +03:00
Martin Storsjö 0b3ac9fe05 rtpdec_h264: Cosmetic cleanup
Add/fix spacing, split long lines, align assignments where suitable.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 20:33:00 +03:00
Martin Storsjö f3d471f45f rtpdec_h264: Clean up comments
Split long comments, move long comments at the end of lines to
separate lines above, fix vertical alignment, fix up comment style
(unify trailing dots - comments had a mix of 2, 3 or 4 dots, where
it would be just as good without them at all).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 20:32:29 +03:00
Martin Storsjö dee48d095d rtpdec_h264: Convert commented out code into setting an unused variable
It is worth keeping instead of removing, in case reading this
bit becomes necessary at some later point.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 20:32:09 +03:00
Martin Storsjö 44f99fe0f5 rtpdec_h264: Remove a useless ifdef
assert is a no-op if DEBUG isn't defined.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 03:10:25 +03:00
Martin Storsjö 8d43b8b8e8 rtpdec_h264: Remove outdated/useless/incorrect comments
RTCP is handled elsewhere, not in the depacketizer for an
individual format.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 03:10:15 +03:00
Martin Storsjö 5a571d3241 rtpdec_h264: Remove useless memory corruption checks
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 03:09:53 +03:00
Martin Storsjö b7b7354c33 rtpdec_h264: Return proper error codes
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 03:09:44 +03:00
Martin Storsjö 5245adb963 rtpdec_h264: Check the available data length before reading
This makes sure the length is checked for STAP-A type packets.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 03:09:10 +03:00
Ivan Kovtunov de26a4b699 rtpdec_h264: Add input size checks
This fixes crashes if given too short data packets.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-05 03:09:07 +03:00
Ronald S. Bultje 273e6af47b ea: check chunk_size for validity.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-05-04 16:06:26 -07:00
Justin Ruggles e5356ebf22 cosmetics: indentation 2012-05-03 16:28:08 -04:00
Justin Ruggles 8916f1fbcb avformat: only fill-in interpolated timestamps if duration is non-zero
This avoids returning duplicate timestamps for multiple packets when the
demuxer does not provide all timestamps and packet duration is not known.
2012-05-03 16:28:08 -04:00
Justin Ruggles ff499157a1 avformat: remove a workaround for broken timestamps
This modifies pts in situations other than what was intended, leading to
invalid timestamps.

Reverts commit 90bb394dcc
2012-05-03 16:28:08 -04:00
Joakim Plate 68b9ed8391 mpegts: Some additional HDMV types and reg descriptors for mpegts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-05-03 12:13:28 -04:00
Luca Barbato 0ca4642ec5 mkv: mark corrupted packets and return them
Do return error if memory allocation or I/O fails.
2012-04-29 20:22:09 -07:00
Luca Barbato 721af294d9 mkv: forward EMBL block data error
Do not return 0 on error.
2012-04-29 20:22:09 -07:00
Luca Barbato 3b52e9da10 segment: reorder seg_write_header allocation
As pointed by Paul B Mahol <onemda@gmail.com> the previous code could
lead to null pointer dereference.
2012-04-27 14:03:43 -07:00
Luca Barbato e1e146a2d1 avio: make avio_close(NULL) a no-op
Its behaviour in line with ffurl_close(NULL).
2012-04-27 14:03:43 -07:00
Yusuke Nakamura 546adc1fee mov: Parse EC3SpecificBox (dec3 atom).
Skip to parse fields for additional independent substreams and its
associated dependent substreams since libavcodec's E-AC-3 decoder does not
support them yet.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-04-27 16:11:46 -04:00
Martin Storsjö df8aa4598c mpegts: Make sure we don't return uninitialized packets
This fixes crashes, where the demuxer could return 0 even
if the returned AVPacket isn't initialized at all. This
could happen if running into EOF or running out of probesize
with non-seekable sources.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-27 20:05:37 +03:00
Hendrik Leppkes 949d942eef mov: support eac3 audio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-04-25 15:24:14 -04:00
Luca Barbato 8b97ae6484 avf: fix faulty check in has_duration
An invalid duration is AV_NOPTS_VALUE not 0.
2012-04-25 11:40:22 -07:00
Yusuke Nakamura 462a5b7839 isom: Support more DTS codec identifiers.
DTS LBR identifier ('dtse') is not included since libavcodec doesn't support it yet.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-04-23 14:47:17 -04:00
Dale Curtis 7521c4bab2 matroska: Clear prev_pkt between seeks.
The new incremental parser doesn't always clear prev_pkt,
however the packet queue is cleared when seeking. Which leads
to a use-after-free.

Verified using Valgrind.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-04-23 14:21:42 -04:00
Michael Niedermayer 0ca4414d0f audemux: Add a sanity check for the number of channels
Fixes a division by 0.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-23 10:47:38 +03:00
Dale Curtis 8336eb6f85 matroska: Add incremental parsing of clusters.
Reduces the amount of upfront data required for cluster parsing
thus decreasing latency on seek and startup.

The change in the seek-lavf_mkv FATE test is due to incremental
parsing no longer reading as much data as the old parser and
thus not having that additional data to generate index entries
based on keyframes.  Index entries are added correctly as the
file is parsed.

All FATE tests pass and Chrome has been using this patch for ~6
months without issue.

Currently incremental parsing is not supported for files with
SSA tracks since they require merging packets between clusters.
In this case the code falls back to non-incremental parsing.

Signed-off-by: Aaron Colwell <acolwell@chromium.org>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-04-22 17:23:50 -07:00
Martin Storsjö 269cb6751b mpegts: Try seeking back even for nonseekable protocols
The mpegts demuxer reads 5 KB at startup just for discovering
the packet size. Since the default avio buffer size is 32 KB,
the seek back to the start will in most cases be within the
avio buffer, and will in most cases succeed even if the actual
protocol isn't seekable.

This makes the demuxer startup faster/with less data when
reading data from a non-seekable input, by not skipping
the first few KB.

If it fails, don't warn if the protocol isn't seekable, making
it behave as before in the failure case.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-23 00:02:49 +03:00
Yusuke Nakamura 94c9bf8887 mov: Treat keyframe indexes as 1-origin if starting at non-zero.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-04-21 14:04:33 -04:00
Yusuke Nakamura ba9869311f mov: Take stps entries into consideration also about key_off.
Splitted files don't start always from a sync sample.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-04-21 14:04:33 -04:00
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
Anton Khirnov 10fa4ff7bc lavf doxy: document passing options to demuxers. 2012-03-26 10:59:43 +02:00
Anton Khirnov dca9c81d82 lavf doxy: clarify that an AVPacket contains encoded data. 2012-03-26 10:59:42 +02:00
Jindrich Makovicka 3fadb29baf mpegtsenc: allow user triggered PES packet flushing
Signed-off-by: Jindrich Makovicka <jindrich.makovicka@nangu.tv>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-26 11:41:18 +03:00
Martin Storsjö 68893afe1d movenc: Merge if statements
This isn't exactly equivalent with the earlier code for codecs
other than H264 and VC1, but those are two only codecs supported
by this codepath anyway, and it simplifies it a bit.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-25 01:06:49 +02:00
Martin Storsjö d5ed5e7d0c avc: Add a function for converting mp4 style extradata to annex b
Make movenc use this function instead of the current custom
conversion function.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-24 22:53:18 +02:00
Martin Storsjö e20ad71ebb libavformat: Document who sets the AVStream.id field
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-24 22:17:37 +02:00
Alex Converse 5023b89bba xwma: Validate channels and bits_per_coded_sample.
This prevents a SIGFPE later on.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-22 13:57:12 -07:00
Alex Converse 86f2ae06b9 mov: Do not read past the end of the ctts_data table.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-22 13:57:12 -07:00
Alex Converse 3e6e89b3d6 mov: Add missing terminator to mov_ch_layout_map_1ch.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: Libav-stable@libav.org
2012-03-22 13:56:44 -07:00
Ronald S. Bultje e73c6aaabf asf: reset side data elements on packet copy.
Prevents crash (double free) when free()ing the original packet.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-22 12:17:14 -07:00
Michael Niedermayer f0b4a505d8 oggparseogm: fix order of arguments of avpriv_set_pts_info().
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-22 19:51:43 +01:00
Justin Ruggles f036342b4b aiffdec: set block_duration to 1 for PCM codecs that are supported in AIFF-C 2012-03-22 11:45:46 -04:00
Justin Ruggles b38b7cc392 aiffdec: factor out handling of integer PCM for AIFF-C and plain AIFF 2012-03-22 11:45:46 -04:00
Justin Ruggles 2c07c18048 aiffdec: use av_get_audio_frame_duration() to set block_duration for AIFF-C 2012-03-22 11:45:46 -04:00
Justin Ruggles 02f88eec1d aiffdec: do not set bit rate if block duration is unknown
CC: libav-stable@libav.org
2012-03-22 11:45:36 -04:00
Anton Khirnov a6733202cc lavf: make av_interleave_packet_per_dts() private.
There is no reason for it to be public, it's only meant to be used
internally.
2012-03-20 20:12:16 +01:00
Anton Khirnov 3c90cc2ef2 lavf: deprecate av_read_packet().
The caller can achieve the same effect (i.e. getting raw unparsed/mangled
packets) with av_read_frame() and AVFMT_FLAG_NOPARSE |
AVFMT_FLAG_NOFILLIN
2012-03-20 20:12:16 +01:00
Justin Ruggles f63412fc74 oggdec: output correct timestamps for Vorbis
Takes encoder delay into account by comparing first the coded page
duration with the calculated page duration. Handles last packet duration
if needed, also by comparing coded duration with calculated duration.
Also does better handling of timestamp generation for packets in the
first page for streamed ogg files where the start time is not
necessarily zero.
2012-03-20 14:39:57 -04:00
Justin Ruggles 777365fe86 xa: set correct bit rate
Also fixes stream duration calculation.
2012-03-20 14:12:54 -04:00
Justin Ruggles a54bc52265 xa: do not set bit_rate, block_align, or bits_per_coded_sample
The values in the header refer to decoded data, not compressed data.
2012-03-20 14:12:53 -04:00
Justin Ruggles 64de57f645 xa: fix end-of-file handling
Do not output an extra packet when out_size is reached.
Also return AVERROR_EOF instead of AVERROR(EIO).
2012-03-20 14:12:53 -04:00
Justin Ruggles cd2ffb67ad xa: fix timestamp calculation
The packet duration is always 28 samples.
2012-03-20 14:12:53 -04:00
Martin Storsjö 39f5a5462c movenc: Add a min_frag_duration option
The other fragmentation options (frag_duration, frag_size and
frag_keyframe) are combined with OR, cutting fragments at the
first of the conditions being fulfilled.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-20 11:18:05 +02:00
Martin Storsjö ccfa8aa26f rtsp: Set the default delay to 0.1 s for the RTSP/SDP/RTP demuxers
This enables reordering of UDP packets by default, unless the caller
explicitly sets -max_delay 0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-20 10:53:49 +02:00
Martin Storsjö 4fa57d524f libavformat: Set the default for the max_delay option to -1
Make the muxers/demuxers that use the field handle the default
-1 in the same way as 0.

This allows distinguishing an intentionally set 0 from the default
value where the user hasn't set it.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-20 10:53:47 +02:00
Anton Khirnov 5626697104 Move AVFormatContext/AVCodecContext option tables to separate files.
This will allow us to automatically generate manpages for them.
2012-03-20 07:09:18 +01:00
Anton Khirnov 40b41be3fa lavf: use AVStream.discard to disable queueing attached pictures. 2012-03-20 06:53:44 +01:00
Anton Khirnov 01fcc42b90 lavf: requeue attached pictures after seeking.
This allows the caller to get them without special code even after
seeking before receiving any data.
2012-03-20 06:52:33 +01:00
Anton Khirnov 713f3062a7 id3v2: set the keyframe flag on attached pictures. 2012-03-20 06:52:07 +01:00
Derek Buitenhuis 0e714f889e ZeroCodec Decoder
An obscure Japanese lossless video codec, originally intended
for use with a remote desktop application.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-03-19 19:02:23 +01:00
Kostya Shishkov b8560637d9 RealAudio Lossless decoder 2012-03-19 18:46:34 +01:00
Martin Storsjö 316e724f18 rtpenc: Use AVFormatContext.packet_size instead of a private option
The private option has not been part of any release yet (and
it is only of use in quite rare cases), so just remove it instead
of keeping it with deprecation warnings.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-19 18:37:38 +02:00
Nicolas George 01b0ade665 url: Document the expected behaviour of url_read
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-19 16:25:51 +02:00
Martin Storsjö 57151f8674 libavformat: Use AVFormatContext.probesize in init_input
This was forgotten in the transition from av_open_input_file to
avformat_open_input, see 603b8bc2a1.

This doesn't change anything for the default case where the
option isn't set, since PROBE_BUF_MAX is 1048576 (which was
used as max probe size earlier) while the default value for
the probesize option is 5000000, which for the probe function
is clipped to PROBE_BUF_MAX anyway.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-19 16:08:08 +02:00