[FFmpeg-devel] [PATCH] rmdec.c: support for multirate files

Ronald S. Bultje rsbultje
Thu Jan 1 00:56:47 CET 2009


On Wed, Dec 31, 2008 at 4:22 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> New patch attached.

As a side-note and a question: I've noticed the lack of a seek
implementation in the RM demuxer. url_fseek() has a default
implementation that uses url_fseek(). It doesn't really work for me,
but maybe that's just me. I end up in random positions, not what I
intended to seek towards, and it locks after a few seeks saying
"read_timestamp() failed in the middle". Anyway, I'm not sure if this
is supposed to work or ever worked, but...

My patch adds a "cur_offset" variable that we seek to every next call
to read_packet(). This obviously makes any sort of default seeking
impossible, since we seek to one of the cur_offsets+framesizes
whenever getting a new packet, thus making the previous call in the
default av_seek() to url_seek() undone.

My questions:
- is it bad practice to have a cur_offset variable and seek to it?
- what if I would seek to it *before* returning from av_read_packet()?
That way, I could get rid of the cur_offset and just cache the last
timestamp and seek to the next predicted (or forward-read) timestamp.
- or is RM seeking not supposed to work, should I not care (for now)
and just implement a rm_read_seek() asap?


More information about the ffmpeg-devel mailing list