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>
This prevents failed assertions further down in the packet processing
where we require non-negative values for packet_size_left.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
H263 in RTP can be packetized in two formats (RFC 2190, RFC
2429/4629). The former normally uses the static payload type 34,
while the latter normally uses dynamic payload types with the
SDP format names H263-1998 or H263-2000.
Look for packets that don't look like proper RFC 2190 packets and
switch to depacketizing them according to the new format if they
match some heuristic criteria.
Signed-off-by: Martin Storsjö <martin@martin.st>
In order to match Linux behaviour better our
Windows-specific open() replacement should disable
Windows default file locking.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This needs the extradata to be extracted.
The approach used is the one MPlayer uses, though it is
unclear whether the 4 bytes extradata that are skipped
should be skipped always or only for AAC.
The AAC parser must be disabled, too, otherwise playback
still does not work.
Fixes trac issue #547.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
According to 14496-12, the duration should be all 1s if
the duration is unknown. This is the case if writing a moov
atom without any samples described in it (e.g. as in ismv files).
Signed-off-by: Martin Storsjö <martin@martin.st>
This allows handling matroska files with errors.
Fixes test4.mkv and test7.mkv from the official Matroska test suite.
These are also trac issues #544 and #545.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Muxing pcm audio in MOV using avcodec_encode_audio() was failing
because avcodec_encode_audio() returns an incorrect packet size of 4
bytes. This can be reproduced by modifying the sample
ffmpeg/doc/examples/muxing.c to encode PCM, see ML patch
muxing-test.diff
I git bisected and commit 89ddff92a3 is the one that broke this. In
mov_write_header() if st->codec->frame_size <= 1 it sets it to 1. Then
avcodec_encode_audio() sets frame->nb_samples = avctx->frame_size, and
frame->nb_samples of 1 is used to compute a packet size of 4 bytes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
According to unofficial documentation, the video rate is locked to the audio
sample rate. This results in proper synchronization of audio and video
timestamps from the demuxer. This only works if the first audio packet occurs
before the first video packet or the audio sample rate is the default rate of
11111 Hz, both of which are true for all samples in our archive.
This avoids initializing a stream with dummy values or when the file does not
contain audio.
Also set duration for audio packets, using the sample rate as the time base.
Update FATE reference to account for now non-existent palette packet.
This also fixes the FATE test if frame data is not initialized in
get_buffer(), so update comment in avconv accordingly.
The rtp demuxer which listens for RTP packets and detects the
RTP payload type will currently get confused if the first packet
received is an RTCP packet. Thus ignore such packets.
Signed-off-by: Martin Storsjö <martin@martin.st>
Prefix the functions/tables brktimegm, pcm_read_seek,
dv_offset_reset, voc_get_packet, codec_movaudio_tags,
codec_movvideo_tags.
After this, lavf has no global symbols without the proper prefix.
Signed-off-by: Martin Storsjö <martin@martin.st>
Keep the old protocol name around for backwards compatibility
until the next bump.
Deprecate the method of implicitly assuming the nested protocol.
For applehttp://server/path, it might have felt logical, but
supporting hls://server/path isn't quite as intuitive. Therefore
only support hls+http://server/path from now on.
Using this protocol at all is discouraged, since the hls demuxer
is more complete and fits into the architecture better. There
have been cases where the protocol implementation worked better
than the demuxer, but this should no longer be the case.
Signed-off-by: Martin Storsjö <martin@martin.st>
When this demuxer was created, there didn't seem to be any
consensus of a common short name for this protocol. Now
the consensus seems to be to call it hls.
Signed-off-by: Martin Storsjö <martin@martin.st>
This is different from the "modern" RTP payload formats for H263
as defined by RFC 4629, 2429 and 3555. According to the newer RFCs,
this old one is to be considered deprecated and only be used for
interoperating with legacy systems.
Signed-off-by: Martin Storsjö <martin@martin.st>
This allows easily differentiating between both implementations within the build
system and combining the native implementation for plain RTMP with librtmp for
the RTMPE, RTMPS, RTMPT, RTMPTE protocol variants.
If muxing into mpegts, 4 byte startcodes for the first NAL
of an access unit is required. Thus it is simplest for the
RTP depacketizer to just use 4 byte startcodes everywhere.
Signed-off-by: Martin Storsjö <martin@martin.st>
In particular, detect when the index is obviously broken.
This fixes the worst symptoms of trac issue #958 and makes
sense to allow seeking in files without index.
However it is possible that there still is an index parsing bug
with that file.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Otherwise when we run into levels beyond the max. allowed
playback will be permanently broken.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>