FFmpeg/libavformat
Ronald S. Bultje 7a160bca83 Fix index generation in the way that it was supposed to be used. See the
discussion in the ML thread "[PATCH] rmdec.c: merge old/new packet reading
code".

Over time, this code broke somewhat, e.g. seq was never actually written
into (and was thus always 1, therefore the seq condition was always true),
whereas it was supposed to be set to the sequence number of the video slice
in case the video frame is divided over multiple RM packets (slices). The
problem of this is that packets other than those containing the beginning
of a video frame would be indexed as well.
Secondly, flags&2 is supposed to be true for video keyframes and for these
audio packets containing the start of a block. For some codecs (e.g. AAC),
that is every single packet, whereas for others (e.g. cook), that is the
packet containing the first of a series of scrambled packets that are to be
descrambled together. Indexing any of the following would lead to incomplete
and thus useless frames. Problem here is that flags would be reset to 2 to
indicate that the first packet is ready to be returned, and in addition if
no data was left to be returned (which is always true for the first packet),
then we wouldn't actually write the index entry anyway.
All in all, the idea was good and it probably worked at some point, but that
is long ago. This patch should at the very least make it likely for this code
to be executed again at the right times, i.e. the way it was originally
intended to be used.

Originally committed as revision 17993 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-15 20:14:25 +00:00
..
4xm.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
adtsenc.c ADTS: Increased protection against writing illegal/nonsense files. 2009-03-06 21:19:16 +00:00
aiff.c use new metadata API in aiff demuxer 2009-02-02 23:43:12 +00:00
allformats.c VQF demuxer 2009-03-07 22:42:09 +00:00
amr.c Change semantic of CONFIG_*, HAVE_* and ARCH_*. 2009-01-13 23:44:16 +00:00
apc.c Bump Major version, this commit is almost just renaming bits_per_sample to 2008-09-08 14:24:59 +00:00
ape.c apedec: display a warning when truncating a metadata tag 2009-02-17 15:44:11 +00:00
asf.c Add some basic metadata conversion tables for matroska and asf. 2009-03-01 00:12:08 +00:00
asf.h Add some basic metadata conversion tables for matroska and asf. 2009-03-01 00:12:08 +00:00
asfcrypt.c Add and use a public API for RC4 and DES, analogous to the AES API. 2009-02-03 14:20:55 +00:00
asfcrypt.h Globally rename the header inclusion guard names. 2008-08-31 07:39:47 +00:00
asfdec.c Add some basic metadata conversion tables for matroska and asf. 2009-03-01 00:12:08 +00:00
asfenc.c Add some basic metadata conversion tables for matroska and asf. 2009-03-01 00:12:08 +00:00
assdec.c Silence "assdec.c:146: warning: passing argument 4 of ‘qsort’ from incompatible pointer type" 2009-02-14 15:44:46 +00:00
assenc.c ASS/SSA muxer. 2008-09-26 19:42:21 +00:00
au.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
audiointerleave.c Reorder arguments for av_fifo_generic_read to be more logical and 2009-03-09 17:47:47 +00:00
audiointerleave.h Allocate AVFifoBuffer through the fifo API to reduce future API/ABI issues. 2009-03-08 14:16:55 +00:00
avc.c support h264 extradata with 0x000001 startcode 2009-01-16 01:26:52 +00:00
avc.h 10l, fix prototype 2009-01-16 01:20:31 +00:00
avformat.h Pass packet position to the parser, so frame's AVPacket.pos is computed correctly. 2009-03-05 07:36:16 +00:00
avi.h Globally rename the header inclusion guard names. 2008-08-31 07:39:47 +00:00
avidec.c Check for alloc failures. 2009-02-21 20:57:46 +00:00
avienc.c Add AVFMT_VARIABLE_FPS to specify which muxers do not need duplicated frames. 2009-02-24 15:04:18 +00:00
avio.c Add url_get_file_handle(), which is used to get the file descriptor 2009-03-03 17:04:51 +00:00
avio.h Add url_get_file_handle(), which is used to get the file descriptor 2009-03-03 17:04:51 +00:00
aviobuf.c Merge declaration and initialization of io_buffer_size 2009-01-16 16:39:17 +00:00
avisynth.c Restore mistakenly removed period after "DivX, Inc". 2009-01-19 17:01:22 +00:00
avs.c avoid POSIX reserved _t suffix 2008-12-11 22:34:14 +00:00
bethsoftvid.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
bfi.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
c93.c avoid POSIX reserved _t suffix 2008-12-11 22:34:14 +00:00
crcenc.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
cutils.c Do not misuse unsigned long to store pointers. 2009-02-04 05:56:39 +00:00
daud.c Change semantic of CONFIG_*, HAVE_* and ARCH_*. 2009-01-13 23:44:16 +00:00
dsicin.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
dv.c dv probe 2009-02-26 08:45:59 +00:00
dv.h cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
dvenc.c Allocate AVFifoBuffer through the fifo API to reduce future API/ABI issues. 2009-03-08 14:16:55 +00:00
dxa.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
eacdata.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
electronicarts.c Add av_uninit macro to variable to avoid false positive warning: 2009-02-11 15:01:52 +00:00
ffm.h cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
ffmdec.c return error if read failed 2009-02-12 02:17:16 +00:00
ffmenc.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
file.c Add url_get_file_handle(), which is used to get the file descriptor 2009-03-03 17:04:51 +00:00
flacdec.c flacdec: Parse the metadata header in the raw FLAC demuxer. 2009-03-06 01:31:10 +00:00
flacenc.c Share the function to write a raw FLAC header and use it in the Matroska 2009-02-26 02:41:53 +00:00
flacenc.h Share the function to write a raw FLAC header and use it in the Matroska 2009-02-26 02:41:53 +00:00
flic.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
flv.h Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
flvdec.c Replace two 'return AVERROR(EAGAIN);' by continue. The latter are nicer 2009-03-03 20:24:17 +00:00
flvenc.c Splits the totalbitrate in a videodatarate and audiodatarate part. 2009-02-02 16:10:46 +00:00
framecrcenc.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
gif.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
gopher.c Gopher protocol, patch by Toshimitsu Kimura, lovesyao gmail com 2009-02-11 16:28:46 +00:00
gxf.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
gxf.h Avoid _t in gxf enum type names 2008-12-13 21:58:17 +00:00
gxfenc.c reindent 2009-03-09 04:17:12 +00:00
http.c Add url_get_file_handle(), which is used to get the file descriptor 2009-03-03 17:04:51 +00:00
id3v2.c Fix probing of files with ID3v2 tags. Discussed at 2009-01-19 21:54:06 +00:00
id3v2.h Fix probing of files with ID3v2 tags. Discussed at 2009-01-19 21:54:06 +00:00
idcin.c Use more descriptive format long_names. 2009-02-12 17:26:06 +00:00
idroq.c Simplify RoQ demuxer pts calculation by using a appropriate time bases. 2009-03-13 13:37:35 +00:00
iff.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
img2.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
internal.h remove now useless av_set_program_name() function 2009-02-10 00:27:42 +00:00
ipmovie.c Simplify ipmovie.c pts calculation by using an appropriate time_base. 2009-02-27 10:07:12 +00:00
isom.c return -1 for errors in ff_mov_iso639_to_lang() to allow for error checking 2009-02-26 13:11:18 +00:00
isom.h allocate palette in codec directly 2009-03-15 09:44:57 +00:00
iss.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
libnut.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
lmlm4.c Fix build: Add intreadwrite.h and bswap.h #includes where necessary. 2009-01-11 22:19:48 +00:00
Makefile VQF demuxer 2009-03-07 22:42:09 +00:00
matroska.c Add some basic metadata conversion tables for matroska and asf. 2009-03-01 00:12:08 +00:00
matroska.h Add some basic metadata conversion tables for matroska and asf. 2009-03-01 00:12:08 +00:00
matroskadec.c Add some basic metadata conversion tables for matroska and asf. 2009-03-01 00:12:08 +00:00
matroskaenc.c Share the function to write a raw FLAC header and use it in the Matroska 2009-02-26 02:41:53 +00:00
metadata.c simplify metadata conversion and fixes gcc-2.95 at the same time 2009-03-01 14:29:30 +00:00
metadata.h add a metadata conversion API 2009-02-28 23:34:16 +00:00
metadata_compat.c don't trigger metadata compatibility code when user app already set metadata 2009-02-26 13:00:13 +00:00
mm.c Add a context to av_log() call and update the trace not to be redundant. 2009-02-16 16:27:08 +00:00
mmf.c Use more descriptive format long_names. 2009-02-12 17:26:06 +00:00
mov.c typo in the mail, the 4am commit is always the worst 2009-03-15 10:53:12 +00:00
movenc.c typo in the mail, the 4am commit is always the worst 2009-03-15 10:53:12 +00:00
mp3.c Change a bunch of codec long_names to be more consistent and descriptive. 2009-03-02 05:18:33 +00:00
mpc.c Fix probing of files with ID3v2 tags. Discussed at 2009-01-19 21:54:06 +00:00
mpc8.c Bump Major version, this commit is almost just renaming bits_per_sample to 2008-09-08 14:24:59 +00:00
mpeg.c Mark dvdaudio_substream_type variable as av_uninit to work around false 2009-03-05 19:13:12 +00:00
mpeg.h cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
mpegenc.c Reorder arguments for av_fifo_generic_read to be more logical and 2009-03-09 17:47:47 +00:00
mpegts.c Change TS seeking so it returns position/timestamp of a key frame. 2009-02-28 18:35:53 +00:00
mpegts.h cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
mpegtsenc.c use new metadata API in mpegts muxer 2009-02-18 00:00:38 +00:00
mpjpeg.c cosmetics: format long_name spelling fixes 2009-02-12 17:24:17 +00:00
msnwc_tcp.c Make long_names in lavf/lavdev optional depending on CONFIG_SMALL. 2008-06-03 16:20:54 +00:00
mtv.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
mvi.c Bump Major version, this commit is almost just renaming bits_per_sample to 2008-09-08 14:24:59 +00:00
mxf.c reuse MXFCodecUL for data def and simplify 2009-02-08 05:12:30 +00:00
mxf.h reuse MXFCodecUL for data def and simplify 2009-02-08 05:12:30 +00:00
mxfdec.c reuse MXFCodecUL for data def and simplify 2009-02-08 05:12:30 +00:00
mxfenc.c use utc time for timestamp and do not set it if not specified 2009-03-14 23:39:52 +00:00
ncdec.c 10l: fix compiler warning: 2009-02-08 21:42:06 +00:00
network.h Fix undefined preprocessor directives warnings during 'make checkheaders'. 2009-01-24 14:52:46 +00:00
nsvdec.c use new metadata API in nsv demuxer 2009-02-18 00:02:38 +00:00
nut.c remove _t for POSIX compatibility. 2008-12-11 19:06:24 +00:00
nut.h Remove misleading comment, _t is POSIX-reserved namespace. 2008-12-13 16:08:31 +00:00
nutdec.c use new metadata API in nut demuxer 2009-02-27 23:10:34 +00:00
nutenc.c use new metadata API in nut muxer 2009-02-27 23:12:14 +00:00
nuv.c Enable generic index creation and seeking for NUV demuxer. 2009-03-14 22:07:15 +00:00
oggdec.c Use consistent indent style in oggdec. 2009-02-14 13:44:21 +00:00
oggdec.h Delete unnecessary 'extern' keywords. 2008-12-03 15:23:30 +00:00
oggenc.c Use a shared function to validate FLAC extradata. 2009-02-26 02:29:24 +00:00
oggparseflac.c use function and definitions from libavcodec/flac.h in oggparseflac.c 2009-01-25 01:21:10 +00:00
oggparseogm.c OGG: untypedef demuxer structs 2008-11-06 01:50:56 +00:00
oggparsespeex.c OGG: untypedef demuxer structs 2008-11-06 01:50:56 +00:00
oggparsetheora.c OGG: correct PTS with old theora streams 2008-11-06 01:57:17 +00:00
oggparsevorbis.c use av_malloc() in vorbis_comment() 2009-02-12 21:39:37 +00:00
oma.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
options.c deprecate old metadata API 2009-03-01 16:35:25 +00:00
os_support.c Change semantic of CONFIG_*, HAVE_* and ARCH_*. 2009-01-13 23:44:16 +00:00
os_support.h Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
psxstr.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
pva.c Make long_names in lavf/lavdev optional depending on CONFIG_SMALL. 2008-06-03 16:20:54 +00:00
qtpalette.h Globally rename the header inclusion guard names. 2008-08-31 07:39:47 +00:00
r3d.c use new metadata API in r3d demuxer 2009-03-01 15:28:56 +00:00
raw.c Make pcm_read_seek treat negative time stamps as 0, this avoids incorrectly 2009-03-14 20:50:54 +00:00
raw.h Separate the raw FLAC demuxer from raw.c and put in a new file, 2009-02-28 17:24:46 +00:00
rdt.c Don't (ab)use PKT_FLAG_* in RTP code, since the two have virtually nothing 2009-02-26 14:23:05 +00:00
rdt.h Split rtp.h in rtp.h, rtpdec.h, and rtpenc.h 2009-02-06 10:35:52 +00:00
riff.c sn40 avi fourcc decodes with ffodivx 2009-03-11 01:36:25 +00:00
riff.h Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
rl2.c cosmetics: format long_name spelling fixes 2009-02-12 17:24:17 +00:00
rm.c use new metadata API in rm (de)muxer 2009-02-17 21:40:38 +00:00
rm.h use new metadata API in rm (de)muxer 2009-02-17 21:40:38 +00:00
rmdec.c Fix index generation in the way that it was supposed to be used. See the 2009-03-15 20:14:25 +00:00
rmenc.c use new metadata API in rm (de)muxer 2009-02-17 21:40:38 +00:00
rpl.c cosmetics: vertical alignment 2009-02-26 22:39:53 +00:00
rtp.c Remame rtp_get_codec_info() to ff_rtp_get_codec_info(), as it is not 2009-02-17 08:12:51 +00:00
rtp.h Document ff_rtp_codec_id() 2009-02-28 19:34:50 +00:00
rtp_aac.c Merge rtp_aac.h and rtp_mpv.h in rtpenc.h 2009-02-06 15:30:41 +00:00
rtp_h264.c Don't let finalize_packet() touch pkt->stream_index. Instead, let individual 2009-03-03 13:51:34 +00:00
rtp_h264.h Split rtp.h in rtp.h, rtpdec.h, and rtpenc.h 2009-02-06 10:35:52 +00:00
rtp_mpv.c Split rtp.h in rtp.h, rtpdec.h, and rtpenc.h 2009-02-06 10:35:52 +00:00
rtpdec.c Don't let finalize_packet() touch pkt->stream_index. Instead, let individual 2009-03-03 13:51:34 +00:00
rtpdec.h Add url_get_file_handle(), which is used to get the file descriptor 2009-03-03 17:04:51 +00:00
rtpenc.c Rename rtp_get_payload_type() to ff_rtp_get_payload_type(), as it is not 2009-02-16 09:36:21 +00:00
rtpenc.h Do not use RTP_MAX_PACKET_LENGTH in the RTP muxer 2009-02-06 20:41:15 +00:00
rtpenc_h264.c Split rtp.h in rtp.h, rtpdec.h, and rtpenc.h 2009-02-06 10:35:52 +00:00
rtpproto.c Add url_get_file_handle(), which is used to get the file descriptor 2009-03-03 17:04:51 +00:00
rtsp.c rtpmap is case-insensitive, see comment from Luca in "[PATCH] rtsp.c: 2009-03-07 15:20:55 +00:00
rtsp.h Document rtsp.h, see "[PATCH] document rtsp.h" thread. 2009-02-26 14:15:41 +00:00
rtspcodes.h Globally rename the header inclusion guard names. 2008-08-31 07:39:47 +00:00
sdp.c Rename rtp_get_payload_type() to ff_rtp_get_payload_type(), as it is not 2009-02-16 09:36:21 +00:00
segafilm.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
sierravmd.c Add a context to av_log() call. 2009-02-16 14:45:05 +00:00
siff.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
smacker.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
sol.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
swf.h remove unused fields in swf context 2009-03-14 22:49:01 +00:00
swfdec.c swf timestamps are 16 bits 2009-03-14 22:51:38 +00:00
swfenc.c Reorder arguments for av_fifo_generic_read to be more logical and 2009-03-09 17:47:47 +00:00
tcp.c Add url_get_file_handle(), which is used to get the file descriptor 2009-03-03 17:04:51 +00:00
thp.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
tiertexseq.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
timefilter.c Add my name to copyright & author as requested by the original author. 2009-03-06 20:51:50 +00:00
timefilter.h Add my name to copyright & author as requested by the original author. 2009-03-06 20:51:50 +00:00
tta.c remove ff_get_fourcc() and use AV_RL32() instead 2009-01-17 12:21:01 +00:00
txd.c Add a context to av_log() calls. 2009-03-03 16:19:37 +00:00
udp.c Add url_get_file_handle(), which is used to get the file descriptor 2009-03-03 17:04:51 +00:00
utils.c Add AVFMT_GENERIC_INDEX support also for formats that do not use a parser. 2009-03-14 21:46:00 +00:00
vc1test.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
vc1testenc.c Remove unused variable. 2008-08-13 18:32:16 +00:00
voc.c voc: add ff_ prefix to some global const data 2008-08-24 14:12:03 +00:00
voc.h avoid POSIX reserved _t suffix 2008-12-11 22:34:14 +00:00
vocdec.c Fix build: Add intreadwrite.h and bswap.h #includes where necessary. 2009-01-11 22:19:48 +00:00
vocenc.c avoid POSIX reserved _t suffix 2008-12-11 22:34:14 +00:00
vqf.c VQF demuxer 2009-03-07 22:42:09 +00:00
wav.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
wc3movie.c Fix a condition that causes an infinite loop, but only when compiled with 2009-03-04 05:40:53 +00:00
westwood.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
wv.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00
xa.c Use full internal pathname in doxygen @file directives. 2009-02-01 02:00:19 +00:00
yuv4mpeg.c cosmetics: Remove pointless period after copyright statement non-sentences. 2009-01-19 15:46:40 +00:00