[haiku-development] Re: MediaPlayer in latest build

  • From: David McPaul <dlmcpaul@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 13 Dec 2009 23:26:40 +1100

2009/12/10 David McPaul <dlmcpaul@xxxxxxxxx>:
> 2009/12/9 Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>:
>> David McPaul <dlmcpaul@xxxxxxxxx> wrote:
>>> Has anyone tested MediaPlayer recently on video files?
>>>
>>> I downloaded the latest gcc2 build from the nightlys (r34536) and
>>> found problems playing video files.  The video would start out ok but
>>> slowly degenerate with decoder errors.
>>>
>>> I have not investigated much further but I thought I would see if it
>>> was maybe just a vmware issue or something.
>>
>> It's well possible that my changes brought some regressions; since I
>> currently have problems with overlay using MediaPlayer (that are on my
>> to do list), I have so far only tested audio playback.
>
> Ok I will see if I can figure out where the problem is.

Ok I have committed a fix for the ChunkCache to make video work again.
 I am surprised audio worked.

The main problem was the chunk cache would use up all the memory pool
and then be unable to put new chunks in the cache as
a) the first chunk in the unused list could be too small and there was
no more memory in the pool to allocate a bigger buffer.
b) even if we modfiied the code to search for a chunk large enough we
still might not find one and again no memory available.

I understand you were trying to allow the cache to use all the memory
pool assigned to it but unless we want to make the cache a lot more
complicated I don't see this working very well.

The cache is there to smooth over the reader being unable to keep up
with the decoder, I would prefer if the limit was based on time (ie we
cache x seconds of chunks) but a limited no works fine.

The FindKeyFrame method does not change the buffer position so no need
to empty the cache.

I might also remove the 2048 rounding on the buffers as I don't think
it is valid anymore as the buffers can just match what is read in.

-- 
Cheers
David

Other related posts: