[haiku-bugs] Re: [Haiku] #9458: Memory leak in BMediaFile -> BMediaTrack

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Thu, 22 Dec 2022 14:33:46 -0000

#9458: Memory leak in BMediaFile -> BMediaTrack
--------------------------+------------------------------------------------
  Reporter:  Robert S.    |      Owner:  leavengood
      Type:  bug          |     Status:  assigned
  Priority:  normal       |  Milestone:  R1
 Component:  Kits/Media   |    Version:  R1/Development
  Kit                     |
Resolution:               |   Keywords:  BMediaFile BMediaTrack memory leak
Blocked By:               |   Blocking:  18160
  Platform:  All          |
--------------------------+------------------------------------------------
Comment (by pulkomandy):

 According to https://stackoverflow.com/questions/43389411/how-does-one-
 correctly-avoid-the-avcodec-alloc-context3-leak-from-avformat-new-s it is
 somewhat normal to have leaks in our situation.

 We need to build ffmpeg with a few defines to disable deprecated fields,
 after we make sure we don't use them. The way this works in ffmpeg is:

 - By default, the deprecated fields are enabled, with a compiler warning
 (our ffmpeg add-on triggers several of these). The code does its best to
 populate these fields to keep existing apps working
 - Once the app code has been adjusted, ffmpeg can be recompiled with
 defines to completely disable the deprecated fields and not populate them
 (and not define them, so instead of a warning, we get a compiler error
 becase the field simply does not exist)

 Currently our code in the ffmpeg plug-in triggers several of the
 deprecation warnings. I will solve these. In particular the 1064 bytes one
 might be exactly the one referred to in that StackOverflow discussion (at
 least, the size matches).

 Once the warnings are solved we can see about adjusting our ffmpeg
 compilation to remove all these deprecated fields and hopefully it will
 not break too many other things. Or we can just wait until the next ffmpeg
 version (already released, just need to package it at haikudepot and
 upgrade our decoder), which will remove all the deprecated things from
 previous versions (and add new ones).
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/9458#comment:19>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: