#52: Crash: #get_frame didn't change the buffer
-------------------------+--------------------------------------------------
Reporter: toots | Owner: toots
Type: Bugs | Status: assigned
Priority: 6 | Milestone:
Component: Liquidsoap | Version: 0.3.4
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment (by mrpingouin):
Could you explain the idea of your patch ? To me, the region of the code
that you're modifying has a very precise sense. We could (should?) even
attach more constraints to it, instead of relaxing it as you propose. The
mantra is: in order to manage the complexity of liquidsoap, we must try
our best to ensure good invariants about the behaviour of sources.
The method #is_ready checks that there is an on-going track (must fail or
current <> None) or that a new track can be prepared (#begin_track).
Therefore, the handling of current = None in #get_frame is useless if
#is_ready has been called before.
When is it allowed to call #get_frame without making sure that a source is
ready ? if you know that your source is unfallible. So it seems to me that
we could even assert that in that branch, and also assert that
#begin_track always succeed -- otherwise, it fails anyway because
#get_frame doesn't do anything, which is forbidden.
A possibility here is that smartcross is not checking that its source is
still ready before pulling data out of it. This is a real problem that
actually occured already for cross() or smartcross(), I don't remember
which. There might still be some tests lacking there.
--
Ticket URL: <http://savonet.rastageeks.org/ticket/52#comment:8>
Savonet <http://savonet.rastageeks.org/>
Let's program our stream !