Commit Graph

4729 Commits

Author SHA1 Message Date
Ronald S. Bultje
6a2d3fc30b Merge code for packet reading in "old" (.ra, audio-only) Realmedia files and
the newer (.rm, audio/video) files. See "[PATCH] rmdec.c: merge old/new
packet reading code" thread on mailinglist.

Originally committed as revision 18005 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 12:47:34 +00:00
Baptiste Coudurier
f05783c2db cosmetics, remove useless braces
Originally committed as revision 18004 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 06:46:57 +00:00
Baptiste Coudurier
9bf1b2683c simplify printing
Originally committed as revision 18003 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 06:46:28 +00:00
Baptiste Coudurier
f584386d54 reindent
Originally committed as revision 18002 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 06:44:16 +00:00
Baptiste Coudurier
c6026e4360 fix trkn metadata parsing
Originally committed as revision 18001 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 06:43:38 +00:00
Baptiste Coudurier
0fb44a4e47 move read_udta_string up to avoid forward declaration
Originally committed as revision 18000 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 06:06:05 +00:00
Baptiste Coudurier
873358e5d4 more generic metadata handling
Originally committed as revision 17999 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 06:03:29 +00:00
Baptiste Coudurier
2229a5c60e do not set isom if ctype is not set, happens in mov
Originally committed as revision 17998 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 05:13:55 +00:00
Baptiste Coudurier
df8843c65f search for hdlr atom in meta, some files do not store version+flags
Originally committed as revision 17996 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-15 23:54:53 +00:00
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
Baptiste Coudurier
7c4502c8c4 typo in the mail, the 4am commit is always the worst
Originally committed as revision 17981 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-15 10:53:12 +00:00
Baptiste Coudurier
4909e517fd cosmetics
Originally committed as revision 17980 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-15 10:49:52 +00:00
Baptiste Coudurier
983bdd3788 add my copyright in mov de/muxer
Originally committed as revision 17979 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-15 10:49:28 +00:00
Baptiste Coudurier
e49da8273b allocate palette in codec directly
Originally committed as revision 17976 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-15 09:44:57 +00:00
Baptiste Coudurier
6c00a9dec2 cosmetics, add some whitespaces and empty lines
Originally committed as revision 17975 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-15 09:06:36 +00:00
Baptiste Coudurier
f0f2218dce do not modify sample_count, check against index entries
Originally committed as revision 17972 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-15 07:21:22 +00:00
Baptiste Coudurier
ed6ae6a58b use utc time for timestamp and do not set it if not specified
Originally committed as revision 17971 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-14 23:39:52 +00:00
Baptiste Coudurier
36a12218db swf timestamps are 16 bits
Originally committed as revision 17969 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-14 22:51:38 +00:00
Baptiste Coudurier
40a1d41fd2 remove unused fields in swf context
Originally committed as revision 17968 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-14 22:49:01 +00:00
Baptiste Coudurier
2261a952f9 do not parse timestamp if bitexact is set, should fix regression tests
Originally committed as revision 17967 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-14 22:43:28 +00:00
Reimar Döffinger
881dad9e76 Enable generic index creation and seeking for NUV demuxer.
Originally committed as revision 17966 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-14 22:07:15 +00:00
Reimar Döffinger
74f5ae847d Add AVFMT_GENERIC_INDEX support also for formats that do not use a parser.
Originally committed as revision 17965 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-14 21:46:00 +00:00
Reimar Döffinger
bd36f175ab Make pcm_read_seek treat negative time stamps as 0, this avoids incorrectly
seeking before data_offset and is more consistent with how the generic index
seeking code handles it.

Originally committed as revision 17964 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-14 20:50:54 +00:00
Michael Niedermayer
85b4230f68 Do not lose user flags when passing calls from the new to the old seeking API.
Originally committed as revision 17959 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-14 16:30:51 +00:00
Michael Niedermayer
32d885926d add avformat_seek_file()
Originally committed as revision 17956 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-14 15:51:46 +00:00
Reimar Döffinger
7e04cfba27 Set pkt->pos correctly (to the start of header of the packet) in swfdec.
Originally committed as revision 17953 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-13 22:26:45 +00:00
Baptiste Coudurier
4e35ffa978 fix swf seeking by fixing new stream detection
Originally committed as revision 17952 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-13 19:37:05 +00:00
Reimar Döffinger
abb785f19e Simplify RoQ demuxer pts calculation by using a appropriate time bases.
Originally committed as revision 17946 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-13 13:37:35 +00:00
Reimar Döffinger
15969b55d1 Set video width/height and create audio stream in read_packet instead of
pre-parsing the file in read_header.
This avoids some code duplication and seeking, and also avoids an IO error
for small video-only files (as created during e.g. the FATE encoder test).

Originally committed as revision 17945 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-12 11:47:50 +00:00
Baptiste Coudurier
d168b3fd2d reindent
Originally committed as revision 17940 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-11 08:05:18 +00:00
Baptiste Coudurier
7943a90a0d keep original tag when stream copying subs with ipod format
Originally committed as revision 17939 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-11 08:04:44 +00:00
Baptiste Coudurier
c569bd0632 ipod supports both subs tags
Originally committed as revision 17938 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-11 08:03:42 +00:00
Baptiste Coudurier
80357cfcfb reindent
Originally committed as revision 17937 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-11 08:02:59 +00:00
Baptiste Coudurier
9f52055463 write correct atoms based on tag and not format, fixes subs stream copy
Originally committed as revision 17936 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-11 08:01:39 +00:00
Baptiste Coudurier
d1df4da00b use correct codec tag list for ipod format
Originally committed as revision 17935 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-11 07:59:38 +00:00
Baptiste Coudurier
f344ae8096 again 10l, typo, put_byte instead of put_buffer
Originally committed as revision 17933 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-11 06:48:02 +00:00
Baptiste Coudurier
cafdc1876a attempt to try to generate an random umid
Originally committed as revision 17932 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-11 06:15:00 +00:00
Baptiste Coudurier
a2523ce2e2 fix subs track height, set track->height to codec height if not set
Originally committed as revision 17929 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-11 06:04:56 +00:00
Ben Littler
3596f4e076 sn40 avi fourcc decodes with ffodivx
Originally committed as revision 17928 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-11 01:36:25 +00:00
Ronald S. Bultje
b5b9ff2a1f Correctly skip complete INDX chunks, i.e. read the 32-bit header correctly
and if the size is broken (20 bytes, header-only), calculate the expected
size and skip the index entries anyway. See "[PATCH] rmdec.c: correctly
skip indexes" thread.

Originally committed as revision 17924 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-10 12:55:29 +00:00
Ronald S. Bultje
b8cc5a9fdf Prevent (negative) overflow of rm->remaining_len. This evaluation really only
has two possible outcomes: either len and rm->remaining_len are the same, in
which case we care about the outcome and it is zero, or rm->remaining_len is
currently not in use and we don't care about the outcome. In that case, len
is positive and rm->remaining_len is zero, which leads to a negative result.
This is confusing and could eventually lead to a sign-flip if we skip a lot
of packets (unlikely, but still). Therefore, just always set it to zero.

Originally committed as revision 17919 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-09 22:03:47 +00:00
Ronald S. Bultje
7ccefd08f6 Revert to r17908.
Originally committed as revision 17918 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-09 22:02:06 +00:00
Ronald S. Bultje
88c4339bda Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
move MOVContext from mov.c to isom.h" thread on ML.

Originally committed as revision 17915 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-09 21:53:00 +00:00
Reimar Döffinger
3898eed890 Reorder arguments for av_fifo_generic_read to be more logical and
consistent with av_fifo_generic_write.

Originally committed as revision 17914 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-09 17:47:47 +00:00
Ronald S. Bultje
0ecf9cc900 Prevent (negative) overflow of rm->remaining_len. This evaluation really only
has two possible outcomes: either len and rm->remaining_len are the same, in
which case we care about the outcome and it is zero, or rm->remaining_len is
currently not in use and we don't care about the outcome. In that case, len
is positive and rm->remaining_len is zero, which leads to a negative result.
This is confusing and could eventually lead to a sign-flip if we skip a lot
of packets (unlikely, but still). Therefore, just always set it to zero.

Originally committed as revision 17910 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-09 13:08:19 +00:00
Ronald S. Bultje
21b3752932 Replace separate packet parsing for "old_format" .ra files by a call to
ff_rm_parse_packet(). See "[PATCH] Make RM demuxer behave better with -an
option" thread, which sort-of turned into an aggregate of unrelated rmdec.c
cleanups.

Originally committed as revision 17909 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-09 12:46:32 +00:00
Ronald S. Bultje
dc3685e129 Move frame discarding out of the ff_rm_parse_packet() loop, and respect
rm->audio_pkt_cnt in case multiple packets should be read before the next
syncpoint in the file, so that ffplay -an on a file containing AAC audio
works. See "[PATCH] Make RM demuxer behave better with -an option" thread
on mailinglist.

Originally committed as revision 17908 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-09 12:42:53 +00:00
Reimar Döffinger
d71d64dcc1 Mark all packets from nuv demuxer as keyframes in order to make seeking work.
For proper seeking, they should be set correctly though.

Originally committed as revision 17907 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-09 12:25:13 +00:00
Reimar Döffinger
3a4f91f5ed 100l, to start reading from the first frame we must seek to data_offset,
not 0 in av_seek_frame_generic.

Originally committed as revision 17905 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-09 12:06:31 +00:00
Reimar Döffinger
fb2e95c97a Set AVPacket pos also for audio packets in nuv demuxer.
Originally committed as revision 17904 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-09 11:35:59 +00:00