Commit Graph

201 Commits

Author SHA1 Message Date
Kostya Shishkov
a43b1e74e2 rmdec: parse FPS in RealMedia properly
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-17 15:00:42 +02:00
Kostya Shishkov
48ce8b8da7 Use parsers for RealVideo 3/4 to determine correct PTS
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-17 15:00:42 +02:00
Kostya Shishkov
7c1f6df4b5 rmdec: correct DTS calculation in RealMedia container.
First, container stores only DTS and not PTS as it was believed.
Second, multiple frames in a packet store timestamp instead of position
after the frame length.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-17 15:00:42 +02:00
Michael Niedermayer
1a34478b71 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Fix NASM include directive
  dsputil_mmx: Honor HAVE_AMD3DNOW
  lavf,lavd: remove all usage of AVFormatParameters from demuxers.
  jack: add 'channels' private option.
  VC-1: fix reading of custom PAR.
  Remove redundant and dubious video codec detection by its extradata
  mpeg12: remove repeat-field code disabled since May 2002
  patch checklist: suggest fate instead of regression tests
  Turn on resampling on sudden size change instead of bailing out during recode.
  avtools: reinitialise filter chain when input video stream changes dimensions

Conflicts:
	Makefile
	avconv.c
	doc/developer.texi
	ffplay.c
	libavcodec/x86/dsputil_mmx.c
	libavdevice/libdc1394.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-15 23:35:53 +02:00
Kostya Shishkov
e9fb763611 Remove redundant and dubious video codec detection by its extradata
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-08-15 14:03:01 +02:00
Michael Niedermayer
78accb876c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  ffmpeg: fix some indentation
  ffmpeg: fix operation with --disable-avfilter
  simple_idct: remove disabled code
  motion_est: remove disabled code
  vc1: remove disabled code
  fate: separate lavf-mxf_d10 test from lavf-mxf
  cabac: Move code only used in the cabac test program to cabac.c.
  ffplay: warn that -pix_fmt is no longer working, suggest alternative
  ffplay: warn that -s is no longer working, suggest alternative
  lavf: rename enc variable in utils.c:has_codec_parameters()
  lavf: use designated initialisers for all (de)muxers.
  wav: remove a use of deprecated AV_METADATA_ macro
  rmdec: remove useless ap parameter from rm_read_header_old()
  dct-test: remove write-only variable
  des: fix #if conditional around P_shuffle
  Use LOCAL_ALIGNED in ff_check_alignment()

Conflicts:
	ffmpeg.c
	libavformat/avidec.c
	libavformat/matroskaenc.c
	libavformat/mp3enc.c
	libavformat/oggenc.c
	libavformat/utils.c
	tests/ref/lavf/mxf

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-17 20:12:02 +02:00
Anton Khirnov
dfc2c4d900 lavf: use designated initialisers for all (de)muxers.
It's more readable and less prone to breakage.
2011-07-17 06:58:37 +02:00
Anton Khirnov
412b4367c5 rmdec: remove useless ap parameter from rm_read_header_old() 2011-07-17 06:58:29 +02:00
Michael Niedermayer
f9ecb849ef Merge remote-tracking branch 'qatar/master'
* qatar/master:
  crypto: Use av_freep instead of av_free
  lavf: don't try to free private options if priv_data is NULL.
  swscale: fix types of assembly arguments.
  swscale: move two macros that are only used once into caller.
  swscale: remove unused function.
  options: Add missing braces around struct initializer.
  mov: Remove leftover crufty debug statement with references to a local file.
  dvbsubdec: Fix compilation of debug code.
  Remove all uses of now deprecated metadata functions.
  Move metadata API from lavf to lavu.

Conflicts:
	doc/APIchanges
	libavformat/aiffdec.c
	libavformat/asfdec.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/cafdec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/mp3enc.c
	libavformat/wtv.c
	libavutil/avutil.h
	libavutil/internal.h
	libswscale/swscale.c
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-09 04:47:19 +02:00
Anton Khirnov
d2d67e424f Remove all uses of now deprecated metadata functions. 2011-06-08 07:43:45 +02:00
Michael Niedermayer
99eb31e263 Merge remote-tracking branch 'qatar/master'
* qatar/master: (25 commits)
  Replace custom DEBUG preprocessor trickery by the standard one.
  vorbis: Remove non-compiling debug statement.
  vorbis: Remove pointless DEBUG #ifdef around debug output macros.
  cook: Remove non-compiling debug output.
  Remove pointless #ifdefs around function declarations in a header.
  Replace #ifdef + av_log() combinations by av_dlog().
  Replace custom debug output functions by av_dlog().
  cook: Remove unused debug functions.
  Remove stray extra arguments from av_dlog() invocations.
  targa: fix big-endian build
  v4l2: remove one forgotten use of AVFormatParameters.pix_fmt.
  vfwcap: add a framerate private option.
  v4l2: add a framerate private option.
  libdc1394: add a framerate private option.
  fbdev: add a framerate private option.
  bktr: add a framerate private option.
  oma: check avio_read() return value
  nutdec: remove unused variable
  Remove unused variables
  swscale: allocate larger buffer to handle altivec overreads.
  ...

Conflicts:
	ffmpeg.c
	libavcodec/dca.c
	libavcodec/dirac.c
	libavcodec/error_resilience.c
	libavcodec/h264.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pthread.c
	libavcodec/rv10.c
	libavcodec/s302m.c
	libavcodec/shorten.c
	libavcodec/truemotion2.c
	libavcodec/utils.c
	libavdevice/dv1394.c
	libavdevice/fbdev.c
	libavdevice/libdc1394.c
	libavdevice/v4l2.c
	libavformat/4xm.c
	libavformat/apetag.c
	libavformat/asfdec.c
	libavformat/avidec.c
	libavformat/mmf.c
	libavformat/mpeg.c
	libavformat/mpegenc.c
	libavformat/mpegts.c
	libavformat/oggdec.c
	libavformat/oggparseogm.c
	libavformat/rl2.c
	libavformat/rmdec.c
	libavformat/rpl.c
	libavformat/rtpdec_latm.c
	libavformat/sauce.c
	libavformat/sol.c
	libswscale/utils.c
	tests/ref/vsynth1/error
	tests/ref/vsynth2/error

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-03 05:19:30 +02:00
Mans Rullgard
e65ab9d94f Remove unused variables 2011-06-02 20:06:00 +01:00
Clément Bœsch
adba9c6352 Fix various unused variable warnings
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-30 00:24:01 +02:00
Diego Biurrun
045dd4b928 Replace some commented-out debug printf() / av_log() messages with av_dlog(). 2011-04-29 17:27:01 +02:00
Michael Niedermayer
2cae9809e2 Merge remote branch 'qatar/master'
* qatar/master:
  fate: fix partial run when no samples path is specified
  ARM: NEON fixed-point forward MDCT
  ARM: NEON fixed-point FFT
  lavf: bump minor version and add an APIChanges entry for avio changes
  avio: simplify url_open_dyn_buf_internal by using avio_alloc_context()
  avio: make url_fdopen internal.
  avio: make url_open_dyn_packet_buf internal.
  avio: avio_ prefix for url_close_dyn_buf
  avio: avio_ prefix for url_open_dyn_buf
  avio: introduce an AVIOContext.seekable field
  ac3enc: use generic fixed-point mdct
  lavfi: add fade filter
  Change yadif to not use out of picture lines.
  lavc: deprecate AVCodecContext.antialias_algo
  lavc: mark mb_qmin/mb_qmax for removal on next major bump.

Conflicts:
	doc/filters.texi
	libavcodec/ac3enc_fixed.h
	libavcodec/ac3enc_float.h
	libavfilter/Makefile
	libavfilter/allfilters.c
	libavfilter/vf_fade.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-04 02:15:12 +02:00
Anton Khirnov
8978fedaee avio: introduce an AVIOContext.seekable field
Use it instead of url_is_streamed and AVIOContext.is_streamed.
2011-04-03 22:46:40 +02:00
Mans Rullgard
2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Michael Niedermayer
0fecf2642b Merge remote-tracking branch 'newdev/master'
Conflicts:
	Changelog
	doc/APIchanges
	doc/optimization.txt
	libavformat/avio.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-03-17 17:22:52 +01:00
Anton Khirnov
45a8a02a41 lavf: replace avio_seek(SEEK_CUR) with avio_skip where it makes sense
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-16 22:24:51 -04:00
Anton Khirnov
66e5b1df36 avio: deprecate url_feof
AVIOContext.eof_reached should be used directly instead.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-07 17:20:31 -05:00
Anton Khirnov
384c9c2fa7 avio: add avio_tell macro as a replacement for url_ftell
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit a2704c9712)
2011-03-05 02:29:31 +01:00
Anton Khirnov
a2704c9712 avio: add avio_tell macro as a replacement for url_ftell
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-04 11:26:57 -05:00
Anton Khirnov
74b3f67c9c lavf: replace all uses of url_fskip with avio_seek
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit e356fc57a2)
2011-03-03 14:15:08 +01:00
Anton Khirnov
f59d8ff8cd avio: avio_ prefix for url_fseek
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 6b4aa5dac8)
2011-03-03 14:15:03 +01:00
Anton Khirnov
e356fc57a2 lavf: replace all uses of url_fskip with avio_seek
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-01 12:22:16 -05:00
Anton Khirnov
6b4aa5dac8 avio: avio_ prefix for url_fseek
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-01 12:12:33 -05:00
Anton Khirnov
e63a362857 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
something useful.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit b7effd4e83)
2011-02-22 02:44:37 +01:00
Anton Khirnov
b7effd4e83 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
something useful.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-21 11:23:22 -05:00
Anton Khirnov
471fe57e1a avio: rename ByteIOContext to AVIOContext.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit ae628ec1fd)
2011-02-20 19:05:47 +01:00
Anton Khirnov
ae628ec1fd avio: rename ByteIOContext to AVIOContext.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-20 08:37:15 -05:00
Diego Elio Pettenò
66355be3c3 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.
(cherry picked from commit c6610a216e)
2011-01-28 03:15:34 +01:00
Diego Elio Pettenò
c6610a216e 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.
2011-01-26 22:10:09 +00:00
Reimar Döffinger
c32b701749 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://svn.ffmpeg.org/ffmpeg/trunk
2010-06-06 18:48:49 +00:00
Francesco Lavra
74e8ccad4c 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://svn.ffmpeg.org/ffmpeg/trunk
2010-05-28 18:18:33 +00:00
Zhou Zongyi
aafb822ba5 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://svn.ffmpeg.org/ffmpeg/trunk
2010-05-25 15:39:32 +00:00
Stefano Sabatini
2ef6c1242a 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://svn.ffmpeg.org/ffmpeg/trunk
2010-04-25 14:27:42 +00:00
Stefano Sabatini
2874c81cc8 Replace all remaining occurrences of AVERROR_NOMEM with
AVERROR(ENOMEM).

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

Originally committed as revision 22791 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-03 14:15:00 +00:00
Ronald S. Bultje
7b374c9ff2 Another uninitialized value.
See http://tranquillity.ath.cx/clang/2010-03-30-1/report-e6KUTb.html#EndPath

Originally committed as revision 22783 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-02 14:58:55 +00:00
Ronald S. Bultje
190413cf81 Fix uninitialized value in codepath.
See http://tranquillity.ath.cx/clang/2010-03-30-1/report-40QvF3.html#EndPath

Originally committed as revision 22782 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-02 14:58:03 +00:00
Ronald S. Bultje
ddf8e75ede Remove dead initialization.
Originally committed as revision 22781 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-02 14:56:59 +00:00
Jean-Daniel Dupas
cc947f04cc 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://svn.ffmpeg.org/ffmpeg/trunk
2010-03-31 12:29:58 +00:00
Stefano Sabatini
72415b2adb 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://svn.ffmpeg.org/ffmpeg/trunk
2010-03-30 23:30:55 +00:00
Aurelien Jacobs
1ab0406db1 export rm_reorder_sipr_data() for future use by matroska demuxer
Originally committed as revision 22491 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-12 23:35:59 +00:00
Aurelien Jacobs
adae9fa65e export sipr_subpk_size for future use by matroska demuxer
Originally committed as revision 22490 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-12 23:34:30 +00:00
Ronald S. Bultje
98287358e9 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://svn.ffmpeg.org/ffmpeg/trunk
2010-01-23 09:42:52 +00:00
Ronald S. Bultje
f9664ca026 Use the correct ByteIOContext in extradata parsing.Fixes half of issue
1658.

Originally committed as revision 21095 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-08 17:15:46 +00:00
Michael Niedermayer
17986563eb Get rid of useless casts.
Originally committed as revision 20831 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-13 17:54:09 +00:00
Michael Niedermayer
005d9b57ad 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://svn.ffmpeg.org/ffmpeg/trunk
2009-12-13 16:20:00 +00:00
Carl Eugen Hoyos
a76cf4e197 Use constant CODEC_ID_NONE instead of 0 where appropriate.
Originally committed as revision 20824 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-13 15:28:00 +00:00
Kostya Shishkov
0dae3e13e3 Factor out extradata reading code.
Borrowed from RM demuxer in FFmbc.

Originally committed as revision 20821 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-13 10:07:08 +00:00
Kostya Shishkov
119c61a30f 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
value.

Originally committed as revision 20820 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-13 09:08:58 +00:00
Kostya Shishkov
461ef74116 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://svn.ffmpeg.org/ffmpeg/trunk
2009-12-13 08:51:27 +00:00
Kostya Shishkov
851ef8755b Factor out variable declaration
Originally committed as revision 20818 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-13 08:44:06 +00:00
Reimar Döffinger
cbb5da57cd When resetting vst->pkt.data 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
http://samples.mplayerhq.hu/real/multirate/JustaSpa1937_64kb.rm
that need further fixes, but keeping vst state consistent is still a good idea.

Originally committed as revision 19830 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-13 11:08:59 +00:00
Ronald S. Bultje
7a4a64e7ab Remove old_flags variable, which is a duplicate of the flags variable.
Originally committed as revision 19540 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-07-30 15:05:33 +00:00
Ronald S. Bultje
34bddc39b4 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
updated within ff_rm_parse_packet() anymore, and thus do not need to be
a pointer.

Originally committed as revision 19539 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-07-30 15:04:19 +00:00
Michael Niedermayer
b33d75fd80 Move declarations in sync() closer to where they are used.
Originally committed as revision 18556 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-04-17 14:38:52 +00:00
Ronald S. Bultje
e6b09f4361 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://svn.ffmpeg.org/ffmpeg/trunk
2009-03-22 12:47:16 +00:00
Ronald S. Bultje
83c0ba3dad 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://svn.ffmpeg.org/ffmpeg/trunk
2009-03-21 19:19:09 +00:00
Ronald S. Bultje
e75e603c1a Move "- 12" statement up a bit. See "[PATCH] rmdec.c: prevent zero-length
packets" thread.

Originally committed as revision 18117 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-21 19:18:07 +00:00
Ronald S. Bultje
cf16c17a69 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://svn.ffmpeg.org/ffmpeg/trunk
2009-03-20 01:22:51 +00:00
Måns Rullgård
c3df4a3bfe rmdec: fix crash at end of file
Originally committed as revision 18018 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 20:22:39 +00:00
Ronald S. Bultje
508fe07ab3 More reindent, forgotten in previous commit.
Originally committed as revision 18014 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 13:23:29 +00:00
Ronald S. Bultje
2d6f301470 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://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 13:03:23 +00:00
Ronald S. Bultje
c882927957 Reindent after r18010.
Originally committed as revision 18011 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 13:01:02 +00:00
Ronald S. Bultje
55d330f913 Mark the first output audio frame as keyframe (separate patch from previous,
as requested by Kostya). See "[PATCH] rmdec.c: remove cache access
duplication".

Originally committed as revision 18010 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 12:59:18 +00:00
Ronald S. Bultje
c5efef7be9 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://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 12:57:49 +00:00
Ronald S. Bultje
7268f0bd8e Reindent after r18005.
Originally committed as revision 18007 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-16 12:50:12 +00:00
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
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
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
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
Aurelien Jacobs
1f1ff73156 remove now useless get_str16() from rmdec.c
Originally committed as revision 17397 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-17 21:41:50 +00:00
Aurelien Jacobs
7379d5bc0b use new metadata API in rm (de)muxer
Originally committed as revision 17396 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-17 21:40:38 +00:00
Benoit Fouet
0fd7c133f4 Add a context to av_log() calls.
Originally committed as revision 17377 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-16 16:12:23 +00:00
Diego Biurrun
517ac2434b Use more descriptive format long_names.
Originally committed as revision 17184 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-12 17:26:06 +00:00
Michael Niedermayer
88297e80aa Reformat rdt_demuxer AVCodec struct sanely.
Originally committed as revision 16969 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-03 13:12:20 +00:00
Diego Biurrun
406792e7b0 cosmetics: Remove pointless period after copyright statement non-sentences.
Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-19 15:46:40 +00:00
Diego Biurrun
6a5d31ac25 Fix build: Add intreadwrite.h and bswap.h #includes where necessary.
Originally committed as revision 16556 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-11 22:19:48 +00:00
Dominique Leuenberger
6fde7afa8d 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://svn.ffmpeg.org/ffmpeg/trunk
2009-01-07 23:37:03 +00:00
Michael Niedermayer
ce0453aac9 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://svn.ffmpeg.org/ffmpeg/trunk
2008-12-31 02:47:54 +00:00
Michael Niedermayer
188e67eaf4 Fix indention which was off by 1 space.
Originally committed as revision 16403 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-31 01:54:54 +00:00
Michael Niedermayer
0b4ff0c9ef 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://svn.ffmpeg.org/ffmpeg/trunk
2008-12-31 01:53:12 +00:00
Michael Niedermayer
fce48f5b0b Merge videobuf and audiobuf.
Originally committed as revision 16401 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-31 00:24:54 +00:00
Michael Niedermayer
f48d545736 Simplify the top of rm_assemble_video_frame().
Originally committed as revision 16400 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-30 21:23:02 +00:00
Michael Niedermayer
e45673cb3a Add a few error checks to rm_assemble_video_frame()
Originally committed as revision 16399 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-30 20:51:18 +00:00
Michael Niedermayer
51d6852f43 All non zero returns of rm_assemble_video_frame() are errors, check things
accordingly.

Originally committed as revision 16398 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-30 19:49:27 +00:00
Reimar Döffinger
7d204e67e8 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://svn.ffmpeg.org/ffmpeg/trunk
2008-12-28 23:25:17 +00:00
Ronald S. Bultje
c49a3ec30a 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://svn.ffmpeg.org/ffmpeg/trunk
2008-12-28 23:23:59 +00:00
Ronald S. Bultje
a9f84821c5 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://svn.ffmpeg.org/ffmpeg/trunk
2008-12-28 05:58:23 +00:00
Ronald S. Bultje
886e89d0d0 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.

Originally committed as revision 16366 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-28 00:21:11 +00:00
Ronald S. Bultje
ba61472911 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://svn.ffmpeg.org/ffmpeg/trunk
2008-12-28 00:18:38 +00:00
Ronald S. Bultje
b9b2b8c93b 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://svn.ffmpeg.org/ffmpeg/trunk
2008-12-14 22:26:28 +00:00
Ronald S. Bultje
127ed7b07b Reindent something that looks weird.
Originally committed as revision 16138 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-14 22:24:58 +00:00
Ronald S. Bultje
1edddc99dc 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.

Originally committed as revision 16111 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-13 21:40:20 +00:00
Ronald S. Bultje
a15ebf34c7 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"
on ML.

Originally committed as revision 16110 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-13 21:37:27 +00:00