[MPlayer-cvslog] CVS: main subreader.c,1.147,1.148

Alban Bedel albeu at free.fr
Sat Mar 18 17:55:39 CET 2006

On Sat, 18 Mar 2006 17:09:58 +0100
Jindrich Makovicka <makovick at kmlinux.fjfi.cvut.cz> wrote:

> Ivan Kalvachev wrote:
> > 2006/3/18, Jindrich Makovicka <makovick at kmlinux.fjfi.cvut.cz>:
> >> I don't think it is necessary with the stream_reset calls. Also, the
> >> format detection would have the same problem otherwise, so either revert
> >> this or disable the subtitles completely for unseekable streams.
> > 
> > Not really, the detection reads a line and tries to find know pattern.
> > There is very good chanse that subtitles will be detected in the first
> > 2k (this is the default stream block size).
> > 
> > On the other side enca allocates 256kb buffer and tries to fill it.
> > This for sure will get out of 2kb range.
> Hm... you are right. And stream_reset actually only resets flags, so 
> it's useless for unseekable streams.
> > Possibe solution:
> > 1. add st->block_size check to my function.

block_size define the required block alignment on seek. It's unsed only with
dvd/cd, for most stream type it is 0 (no alignment needed).

> > 2. increase st->block size for the subtitle stream.
> AFAICS, the buffer size is currently hardcoded.
> > 3. decrease enca buffer
> Sounds reasonable - I am going to change guess_cp to decrease the buffer 
> for unseekable streams instead.

I'll second that 256KB seems quiet a lot anyway (many sub files are not
that big). On the other hand we could still run in situations where a single
stream buffer is not enouth anyway.

> > 4. use cache for subtitles. (another fork())
> This is rather ugly.

And it would still fail if the cache is too small.

5. Add some stream_unput() function.

The detection code keep all data it read, when finished it give it back to
the stream. That way it would work in any case.


More information about the MPlayer-cvslog mailing list