mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1195094: P2. Ensure TrackInfo object passed to constructor is never modified. r=cpearce
The PDM documentation states that it is safe to keep a reference to the TrackInfo object provided to the constructor. However, this wasn't enforced by the H264Converter which would modify the object and worse, did in a non thread-safe fashion
This commit is contained in:
parent
1906624f4a
commit
3a242f3099
@ -214,6 +214,8 @@ public:
|
||||
// that the format of the next input sample is about to change.
|
||||
// If video decoder, aConfig will be a VideoInfo object.
|
||||
// If audio decoder, aConfig will be a AudioInfo object.
|
||||
// It is not safe to store a reference to this object and the decoder must
|
||||
// make a copy.
|
||||
virtual nsresult ConfigurationChanged(const TrackInfo& aConfig)
|
||||
{
|
||||
return NS_OK;
|
||||
|
@ -22,6 +22,7 @@ H264Converter::H264Converter(PlatformDecoderModule* aPDM,
|
||||
FlushableTaskQueue* aVideoTaskQueue,
|
||||
MediaDataDecoderCallback* aCallback)
|
||||
: mPDM(aPDM)
|
||||
, mOriginalConfig(aConfig)
|
||||
, mCurrentConfig(aConfig)
|
||||
, mLayersBackend(aLayersBackend)
|
||||
, mImageContainer(aImageContainer)
|
||||
@ -139,7 +140,7 @@ H264Converter::CreateDecoder()
|
||||
}
|
||||
UpdateConfigFromExtraData(mCurrentConfig.mExtraData);
|
||||
|
||||
mDecoder = mPDM->CreateVideoDecoder(mCurrentConfig,
|
||||
mDecoder = mPDM->CreateVideoDecoder(mNeedAVCC ? mCurrentConfig : mOriginalConfig,
|
||||
mLayersBackend,
|
||||
mImageContainer,
|
||||
mVideoTaskQueue,
|
||||
|
@ -53,6 +53,7 @@ private:
|
||||
void OnDecoderInitFailed(MediaDataDecoder::DecoderFailureReason aReason);
|
||||
|
||||
RefPtr<PlatformDecoderModule> mPDM;
|
||||
const VideoInfo& mOriginalConfig;
|
||||
VideoInfo mCurrentConfig;
|
||||
layers::LayersBackend mLayersBackend;
|
||||
RefPtr<layers::ImageContainer> mImageContainer;
|
||||
|
Loading…
Reference in New Issue
Block a user