[haiku-bugs] Re: [Haiku] #13425: MediaExtractor for BUrl crashes on delete

  • From: "fishpond" <trac@xxxxxxxxxxxx>
  • Date: Tue, 11 Apr 2017 16:05:12 -0000

#13425: MediaExtractor for BUrl crashes on delete
------------------------------+----------------------------
   Reporter:  fishpond        |      Owner:  Barrett
       Type:  bug             |     Status:  new
   Priority:  normal          |  Milestone:  Unscheduled
  Component:  Kits/Media Kit  |    Version:  R1/Development
 Resolution:                  |   Keywords:
 Blocked By:                  |   Blocking:
Has a Patch:  0               |   Platform:  All
------------------------------+----------------------------

Comment (by fishpond):

 Hi Barrett, hi Pulkomandy,

 just had a look at and also stepped through the ~MediaExtractor code (in
 assembly...).  There is a neat little comment in there:

         // fSource is owned by the BMediaFile

 I guess that's true when the BPositionIO comes from a file. When it comes
 from a stream it's getting orphaned at some point.

 There is two solutions:[[BR]]

 A - The StreamReader plugin must own and remember the PositionIO it
 created and delete it in it's destructor.

 B - The MediaExtractor deletes fSource when it finds a non-zero fStreamer
 which indicates that the source is not a BMediafile

 I've just successfully tried (B) but would assume that Barrett prefers (A)
 since it is more consistent in that the BMediaExtractor remains more
 agnostic about its source. But who am I to tell...

 Deleting the BPositionIO is entirely sufficient to stop and delete the
 BHTTPRequest, since in case of streaming it's actually a HTTPMediaIO and
 "knows" about its running request. Barrett has implemented it all, it just
 doesn't get called at present.

--
Ticket URL: <https://dev.haiku-os.org/ticket/13425#comment:2>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: