[haiku-commits] Re: haiku: hrev52200 - src/add-ons/media/plugins/ffmpeg

  • From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 09 Aug 2018 09:11:39 +0000

9 août 2018 10:47 "Stefano Ceccherini" <stefano.ceccherini@xxxxxxxxx> a écrit:

Il giorno gio 9 ago 2018 alle ore 10:39 Stefano Ceccherini 
<stefano.ceccherini@xxxxxxxxx> ha
scritto:

You're right.

I think that we should do that only when we've finished passing frames to 
the encoding, but I'm not
sure we can do this with the current api.

It's possible that without this, though, we miss some packets from avcodec ? 
That's the reason I
added this in the first place.

When you enter draining mode, you prevent this from happening, as ffmpeg 
will never
have the "next" frame to work with.
I removed that call. By the way, I noticed that we are doing that in the 
audio encoding path.

Yes, the old API had a "1 in, 1 out" logic which did not work with modern video 
encoding
(and even decoding) techniques. The new API was introduced for this reason, but 
we need to adjust
our API use now.

Flushing the stream on close should be possible through BMediaTrack::Flush and 
BMediaFile::Close,
but may require adjustments to the API between plugins and media kit if these 
events are not
forwarded to the plugin (it is ok to do, we don't have BeOS compatibility at 
this level IIRC).

-- 
Adrien.


Other related posts: