| Branch: | Revision:

ffmpeg / libavformat / rmdec.c @ 66e5b1df

History | View | Annotate | Download (30.7 KB)

# Date Author Comment
66e5b1df 03/07/2011 10:20 PM Anton Khirnov

avio: deprecate url_feof

AVIOContext.eof_reached should be used directly instead.

Signed-off-by: Ronald S. Bultje <>

a2704c97 03/04/2011 04:26 PM Anton Khirnov

avio: add avio_tell macro as a replacement for url_ftell

Signed-off-by: Ronald S. Bultje <>

e356fc57 03/01/2011 05:22 PM Anton Khirnov

lavf: replace all uses of url_fskip with avio_seek

Signed-off-by: Ronald S. Bultje <>

6b4aa5da 03/01/2011 05:12 PM Anton Khirnov

avio: avio_ prefix for url_fseek

Signed-off-by: Ronald S. Bultje <>

b7effd4e 02/21/2011 04:23 PM Anton Khirnov

avio: avio_ prefixes for get_* functions

In the name of consistency:
get_byte -> avio_r8
get_<type> -> avio_r<type>
get_buffer -> avio_read

get_partial_buffer will be made private later

get_strz is left out becase I want to change it later to return...

ae628ec1 02/20/2011 01:37 PM Anton Khirnov

avio: rename ByteIOContext to AVIOContext.

Signed-off-by: Ronald S. Bultje <>

c6610a21 01/26/2011 10:10 PM Diego Elio Pettenò

Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.

This also lists the objects from those two libraries as internal (by adding
the ff_ prefix) so that they can then be hidden via linker scripts.

c32b7017 06/06/2010 06:48 PM Reimar Döffinger

Do not read the RM index when input is streamed (since it requires seeking
forward and then back again) or AVFMT_FLAG_IGNIDX is set.

Originally committed as revision 23509 to svn://

74e8ccad 05/28/2010 06:18 PM Francesco Lavra

Move rm_codec_tags to rm.c so muxer/demuxer can share it.

Patch by Francesco Lavra <francescolavra interfree it>.

Originally committed as revision 23360 to svn://

aafb822b 05/25/2010 03:39 PM Zhou Zongyi

We're using generic tag-to-ID functions, so specific codec_id assignments
are no longer necessary. Patch by Zhou Zongyi <zhouzy AT os pku edu cn>.

Originally committed as revision 23312 to svn://

2ef6c124 04/25/2010 02:27 PM Stefano Sabatini

Mark av_metadata_set() as deprecated, and use av_metadata_set2()
in its place.

av_metadata_set() is going to be dropped at the next major bump.

Originally committed as revision 22961 to svn://

2874c81c 04/03/2010 02:15 PM Stefano Sabatini

Replace all remaining occurrences of AVERROR_NOMEM with

AVERROR_NOMEM is deprecated and will be dropped at the next libavutil
major bump.

Originally committed as revision 22791 to svn://

7b374c9f 04/02/2010 02:58 PM Ronald S. Bultje

Another uninitialized value.


Originally committed as revision 22783 to svn://

190413cf 04/02/2010 02:58 PM Ronald S. Bultje

Fix uninitialized value in codepath.


Originally committed as revision 22782 to svn://

ddf8e75e 04/02/2010 02:56 PM Ronald S. Bultje

Remove dead initialization.

Originally committed as revision 22781 to svn://

cc947f04 03/31/2010 12:29 PM Jean-Daniel Dupas

Replace all occurences of PKT_FLAG_KEY with AV_PKT_FLAG_KEY.

Patch by Jean-Daniel Dupas, devlists shadowlab org

Originally committed as revision 22744 to svn://

72415b2a 03/30/2010 11:30 PM Stefano Sabatini

Define AVMediaType enum, and use it instead of enum CodecType, which
is deprecated and will be dropped at the next major bump.

Originally committed as revision 22735 to svn://

1ab0406d 03/12/2010 11:35 PM Aurelien Jacobs

export rm_reorder_sipr_data() for future use by matroska demuxer

Originally committed as revision 22491 to svn://

adae9fa6 03/12/2010 11:34 PM Aurelien Jacobs

export sipr_subpk_size for future use by matroska demuxer

Originally committed as revision 22490 to svn://

98287358 01/23/2010 09:42 AM Ronald S. Bultje

Print a warning when DATA chunk is encountered in the middle of chunk.
From multirate RM patch by Ronald S. Bultje

Originally committed as revision 21392 to svn://

f9664ca0 01/08/2010 05:15 PM Ronald S. Bultje

Use the correct ByteIOContext in extradata parsing.Fixes half of issue

Originally committed as revision 21095 to svn://

17986563 12/13/2009 05:54 PM Michael Niedermayer

Get rid of useless casts.

Originally committed as revision 20831 to svn://

005d9b57 12/13/2009 04:20 PM Michael Niedermayer

Print extradata in case of failure. I had this in my local tree and it
might be usefull for others ...

Originally committed as revision 20828 to svn://

a76cf4e1 12/13/2009 03:28 PM Carl Eugen Hoyos

Use constant CODEC_ID_NONE instead of 0 where appropriate.

Originally committed as revision 20824 to svn://

0dae3e13 12/13/2009 10:07 AM Kostya Shishkov

Factor out extradata reading code.
Borrowed from RM demuxer in FFmbc.

Originally committed as revision 20821 to svn://

119c61a3 12/13/2009 09:08 AM Kostya Shishkov

RM audio stream version should be 16-bit followed by header size or reserved
word, so treat it this way instead of extracting different parts from 32-bit

Originally committed as revision 20820 to svn://

461ef741 12/13/2009 08:51 AM Kostya Shishkov

Make RM demuxer look more like proper demuxer by introducing codec tags
instead of many strcmp() on always four-byte strings.
Idea borrowed from RM demuxer in FFmbc by Baptiste Coudurier.

Originally committed as revision 20819 to svn://

851ef875 12/13/2009 08:44 AM Kostya Shishkov

Factor out variable declaration

Originally committed as revision 20818 to svn://

cbb5da57 09/13/2009 11:08 AM Reimar Döffinger

When resetting vst-> to NULL, also set vst->slices.
This avoids a crash when the next slice is not a start slice and thus
pkt->data is still NULL.
This probably only happens with broken or unsupported files like

7a4a64e7 07/30/2009 03:05 PM Ronald S. Bultje

Remove old_flags variable, which is a duplicate of the flags variable.

Originally committed as revision 19540 to svn://

34bddc39 07/30/2009 03:04 PM Ronald S. Bultje

Don't use a pointer-to-flags/timestamp in ff_rm_parse_packet(); the function
used to return packet data, which might update the flags/timestamp to be
used for the next packet data returned by the demuxer. However, that was
separated out into a new function, and the flags/timestamp are thus never...

b33d75fd 04/17/2009 02:38 PM Michael Niedermayer

Move declarations in sync() closer to where they are used.

Originally committed as revision 18556 to svn://

e6b09f43 03/22/2009 12:47 PM Ronald S. Bultje

Add a @todo with a comment from Kostya so we don't forget to optimize that at
some point in the future.

Originally committed as revision 18142 to svn://

83c0ba3d 03/21/2009 07:19 PM Ronald S. Bultje

Don't allow to sync on packets of zero-size length, since these are never
valid. See "[PATCH] rmdec.c: prevent zero-length packets" thread.

Originally committed as revision 18118 to svn://

e75e603c 03/21/2009 07:18 PM Ronald S. Bultje

Move "- 12" statement up a bit. See "[PATCH] rmdec.c: prevent zero-length
packets" thread.

Originally committed as revision 18117 to svn://

cf16c17a 03/20/2009 01:22 AM Ronald S. Bultje

Add byte reordering for the SIPRO audio codec. See "rmdec.c: add SIPR codec
try #2" thread. Patch originally by Vladimir Voroshilov.

Originally committed as revision 18062 to svn://

c3df4a3b 03/16/2009 08:22 PM Måns Rullgård

rmdec: fix crash at end of file

Originally committed as revision 18018 to svn://

508fe07a 03/16/2009 01:23 PM Ronald S. Bultje

More reindent, forgotten in previous commit.

Originally committed as revision 18014 to svn://

2d6f3014 03/16/2009 01:03 PM Ronald S. Bultje

Parse index chunk so that seeking in modern .rm files becomes a lot faster.
Has been tested against streamed / non-seekable input and passes make
seektest. See "[PATCH] rmdec.c: parse INDX chunk" thread on mailinglist.

Originally committed as revision 18013 to svn://

c8829279 03/16/2009 01:01 PM Ronald S. Bultje

Reindent after r18010.

Originally committed as revision 18011 to svn://

55d330f9 03/16/2009 12:59 PM Ronald S. Bultje

Mark the first output audio frame as keyframe (separate patch from previous,
as requested by Kostya). See "[PATCH] rmdec.c: remove cache access

Originally committed as revision 18010 to svn://

c5efef7b 03/16/2009 12:57 PM Ronald S. Bultje

Remove packet returning in ff_rm_parse_packet() if we're using the packet
cache, since this can already be accessed through ff_rm_retrieve_cache().
See "[PATCH] rmdec.c: remove cache access duplication" thread.

Originally committed as revision 18009 to svn://

7268f0bd 03/16/2009 12:50 PM Ronald S. Bultje

Reindent after r18005.

Originally committed as revision 18007 to svn://

6a2d3fc3 03/16/2009 12:47 PM Ronald S. Bultje

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://

7a160bca 03/15/2009 08:14 PM Ronald S. Bultje

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

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),...

b5b9ff2a 03/10/2009 12:55 PM Ronald S. Bultje

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://

b8cc5a9f 03/09/2009 10:03 PM Ronald S. Bultje

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...

7ccefd08 03/09/2009 10:02 PM Ronald S. Bultje

Revert to r17908.

Originally committed as revision 17918 to svn://

0ecf9cc9 03/09/2009 01:08 PM Ronald S. Bultje

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...

21b37529 03/09/2009 12:46 PM Ronald S. Bultje

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

Originally committed as revision 17909 to svn://

dc3685e1 03/09/2009 12:42 PM Ronald S. Bultje

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...

1f1ff731 02/17/2009 09:41 PM Aurelien Jacobs

remove now useless get_str16() from rmdec.c

Originally committed as revision 17397 to svn://

7379d5bc 02/17/2009 09:40 PM Aurelien Jacobs

use new metadata API in rm (de)muxer

Originally committed as revision 17396 to svn://

0fd7c133 02/16/2009 04:12 PM Benoit Fouet

Add a context to av_log() calls.

Originally committed as revision 17377 to svn://

517ac243 02/12/2009 05:26 PM Diego Biurrun

Use more descriptive format long_names.

Originally committed as revision 17184 to svn://

88297e80 02/03/2009 01:12 PM Michael Niedermayer

Reformat rdt_demuxer AVCodec struct sanely.

Originally committed as revision 16969 to svn://

406792e7 01/19/2009 03:46 PM Diego Biurrun

cosmetics: Remove pointless period after copyright statement non-sentences.

Originally committed as revision 16684 to svn://

6a5d31ac 01/11/2009 10:19 PM Diego Biurrun

Fix build: Add intreadwrite.h and bswap.h #includes where necessary.

Originally committed as revision 16556 to svn://

6fde7afa 01/07/2009 11:37 PM Dominique Leuenberger

Fix a compiler warning:
libavformat/rmdec.c:550: warning: assignment makes pointer from integer

Patch by Dominique Leuenberger (dominique-ffmpeg-devel A leuenberger D net)

Originally committed as revision 16489 to svn://

ce0453aa 12/31/2008 02:47 AM Michael Niedermayer

10l set AVPacket.size to the true size of the returned data instead of
the (larger) allocated size. (prevents segfaults due to later failures
from 900MB-sized packets, yes fuzzed file not a valid one)

Originally committed as revision 16404 to svn://

188e67ea 12/31/2008 01:54 AM Michael Niedermayer

Fix indention which was off by 1 space.

Originally committed as revision 16403 to svn://

0b4ff0c9 12/31/2008 01:53 AM Michael Niedermayer

Replace buffer by AVPacket and avoid a memcpy() for video when the number
of allocated slices matches the actual.
Audio still does a copy (marked with FIXME in the code so this is not missed).

Originally committed as revision 16402 to svn://

fce48f5b 12/31/2008 12:24 AM Michael Niedermayer

Merge videobuf and audiobuf.

Originally committed as revision 16401 to svn://

f48d5457 12/30/2008 09:23 PM Michael Niedermayer

Simplify the top of rm_assemble_video_frame().

Originally committed as revision 16400 to svn://

e45673cb 12/30/2008 08:51 PM Michael Niedermayer

Add a few error checks to rm_assemble_video_frame()

Originally committed as revision 16399 to svn://

51d6852f 12/30/2008 07:49 PM Michael Niedermayer

All non zero returns of rm_assemble_video_frame() are errors, check things

Originally committed as revision 16398 to svn://

7d204e67 12/28/2008 11:25 PM Reimar Döffinger

av_free() -> av_freep(), patch by Reimar Doffinger, see discussion in
"rmdec.c: double free" thread on mailinglist.

Originally committed as revision 16379 to svn://

c49a3ec3 12/28/2008 11:23 PM Ronald S. Bultje

Fix double free which happens for playback of .rm files after r16365. See
"rmdec.c: double free" discussion on mailinglist, patch with suggestions
from Reimar Doffinger.

Originally committed as revision 16378 to svn://

a9f84821 12/28/2008 05:58 AM Ronald S. Bultje

Add audio_pkt_cnt return value to ff_rm_retrieve_cache(). See discussion in
"[PATCH] oops I broke rdt.c" mailinglist thread.

Originally committed as revision 16368 to svn://

886e89d0 12/28/2008 12:21 AM Ronald S. Bultje

Add RMStream object as function argument to public functions so that non-.rm
AVStreams can be used to call these public rmdec.c functions as well, as is
the case for RDT/RTSP streams. See mailinglist discussion in "[PATCH] rdt.c:
don't reuse the same AVStream in both RTSP and RM demuxer" thread....

ba614729 12/28/2008 12:18 AM Ronald S. Bultje

Implement RMStream stream-specific private data object in the RM demuxer.
This allows multiple video or audio streams per .rm file. See mailinglist
thread "[PATCH] rmdec.c: implement RMVideo/AudioStream".

Originally committed as revision 16365 to svn://

b9b2b8c9 12/14/2008 10:26 PM Ronald S. Bultje

Use get_buffer() and url_fskip() for some loops of get_byte()s. See discussion in ML thread
"[PATCH] rmdec.c: use get_buffer and skip_bytes instead of loops of get_byte".

Originally committed as revision 16139 to svn://

127ed7b0 12/14/2008 10:24 PM Ronald S. Bultje

Reindent something that looks weird.

Originally committed as revision 16138 to svn://

1edddc99 12/13/2008 09:40 PM Ronald S. Bultje

Split RMContext into RMDemux/MuxContext and make them private in rmdec/enc.c.
Reason for this is that there are no shared entries in the demuxer/muxer
context, making it a mystery as to why it was shared between the two. See
"[PATCH] clean rmdemux/muxcontext" patch on mailinglist....

a15ebf34 12/13/2008 09:37 PM Ronald S. Bultje

Don't access RMContext directly in rdt.c. Rather, use the return value of
ff_rm_parse_packet() to indicate whether more audio packets are available
in the demuxer from the last RM frame, and save that in the RDT parsing
context. See patch/discussion in "[PATCH] rdt.c: don't access RMContext"...

76f940b2 12/11/2008 06:48 PM Ronald S. Bultje

Fix indenting.

Originally committed as revision 16056 to svn://

fcc995a5 11/17/2008 02:20 PM Ronald S. Bultje

Add ByteIOContext argument to public ff_rm_* functions so that we can
specify the data source as function argument instead of in s->pb before
calling the function. Discussed in ML thread "[PATCH] fix small memleak
in rdt.c".

Originally committed as revision 15849 to svn://

f23938f5 10/29/2008 12:16 AM Michael Niedermayer

Check sub_packet_size against 0 to avoid div by zero later.
Fixes issue473

Originally committed as revision 15739 to svn://

2426bb96 09/26/2008 12:12 PM Benjamin Larsson

add ok parts to the rm demuxer for SIPRO support

Originally committed as revision 15426 to svn://

b93dd838 09/23/2008 06:24 AM Vitor Sessak

Add support for RVTR fourCC

Originally committed as revision 15386 to svn://

ff13ba92 09/07/2008 01:21 AM Ronald S. Bultje

Add dynamic payload handlers to rdt.c. These follow the same API as the ones
in rtpdec.c, so that they can be shared and used in the same way in rtsp.c.
The handlers, since they are specific for RDT, are registered in rdt.c and
a new registration function is thus called from allformats.c....

15995030 09/03/2008 12:07 AM Ronald S. Bultje

Move av_set_pts_info() inside the mdpr_read_codecdata() call, so that it is
shared between the RM demuxer and the RTSP/RDT parser; both use the same
timebase. See discussion in "[PATCH] rmdec.c: move av_set_pts_info()" on ML.

Originally committed as revision 15164 to svn://

79d5045d 09/03/2008 12:05 AM Ronald S. Bultje

Use chunk-size in function calling mdpr_read_codecdata() rather than in the
function itself. This way, old-style (.ra4) RTSP/RDT OpaqueData chunks can
be parsed using this function as well (they don't have the size bits). See
discussion on ML in "[PATCH] rmdec.c - small read_mdpr_codecdata() API...

07cb073b 06/23/2008 08:52 AM Diego Biurrun

Remove unused variable, fixes the warning:
libavformat/rmdec.c:280: warning: unused variable 'i'

Originally committed as revision 13909 to svn://

ccafd472 06/20/2008 05:16 PM Baptiste Coudurier

factorize read_header failure freeing code

Originally committed as revision 13837 to svn://

bde15e74 06/03/2008 04:20 PM Stefano Sabatini

Make long_names in lavf/lavdev optional depending on CONFIG_SMALL.
patch by Stefano Sabatini, stefano.sabatini-lala
along with some spelling/consistency fixes for the long names by me

Originally committed as revision 13649 to svn://

437fd77b 06/01/2008 04:25 PM Panagiotis Issaris

Check whether the memory allocation for extradata succeeded. Fixes issue 472.

Originally committed as revision 13603 to svn://

245976da 05/09/2008 11:56 AM Diego Biurrun

Use full path for #includes from another directory.

Originally committed as revision 13098 to svn://

fd31550d 04/09/2008 11:19 PM Michael Niedermayer

Fix seeking in rm.

Originally committed as revision 12779 to svn://

badbe09a 01/17/2008 08:48 PM Roberto Togni

Fix forgotten braces from r11039

Originally committed as revision 11552 to svn://

9b41eb37 01/16/2008 10:47 PM Diego Biurrun

Remove some spaces to keep certain people's eyes from hurting.

Originally committed as revision 11544 to svn://

c807e68f 01/06/2008 10:50 PM Diego Biurrun

cosmetics: Add another pair of parentheses to aid readability.

Originally committed as revision 11437 to svn://

0fd36362 01/04/2008 01:00 PM Ronald S. Bultje

Make three rm demuxer functions non static.
Patch by Ronald S. Bultje rsbultje gmail com
Original thread: [FFmpeg-devel] [PATCH] Realmedia / RTSP (RDT)
Date: 12/28/2007 10:19 PM

Originally committed as revision 11392 to svn://

8f8fae80 01/02/2008 06:53 PM Diego Biurrun

cosmetics: Reindent.

Originally committed as revision 11375 to svn://

b83a8424 01/02/2008 06:53 PM Ronald S. Bultje

Merge double-nested if into && condition.
patch by Ronald S. Bultje, rsbultje gmail com

Originally committed as revision 11374 to svn://

ab19baef 12/04/2007 11:43 PM Roberto Togni


Originally committed as revision 11165 to svn://

e3052ce7 12/02/2007 05:41 PM Roberto Togni

Revert r10892, it's wrong and no longer needed to prevent crashes

Originally committed as revision 11127 to svn://

899681cd 11/21/2007 07:41 AM Björn Axelsson

Use dynamically allocated ByteIOContext in AVFormatContext

patch by: Björn Axelsson, bjorn d axelsson a intinor d se
thread: [PATCH] Remove static ByteIOContexts, 06 nov 2007

Originally committed as revision 11071 to svn://

2b013568 11/19/2007 08:28 PM Roberto Togni

Replace realloc with free+malloc, the previous content of the buffer is
not needed

Originally committed as revision 11065 to svn://

e35033e6 11/19/2007 12:02 AM Roberto Togni


Originally committed as revision 11056 to svn://