mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1195158. Part 2 - Have OggReader send TimedMetadata events through a event source instead of direct calls to AbstractMediaDecoder::QueueMetadata. r=cpearce.
This commit is contained in:
parent
7de6530d5a
commit
623b3a7a28
@ -11,6 +11,7 @@
|
||||
#include "AbstractMediaDecoder.h"
|
||||
#include "MediaInfo.h"
|
||||
#include "MediaData.h"
|
||||
#include "MediaMetadataManager.h"
|
||||
#include "MediaQueue.h"
|
||||
#include "MediaTimer.h"
|
||||
#include "AudioCompactor.h"
|
||||
@ -327,6 +328,10 @@ public:
|
||||
|
||||
virtual void DisableHardwareAcceleration() {}
|
||||
|
||||
TimedMetadataEventSource& TimedMetadataEvent() {
|
||||
return mTimedMetadataEvent;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~MediaDecoderReader();
|
||||
|
||||
@ -418,6 +423,9 @@ protected:
|
||||
bool mHitAudioDecodeError;
|
||||
bool mShutdown;
|
||||
|
||||
// Used to send TimedMetadata to the listener.
|
||||
TimedMetadataEventProducer mTimedMetadataEvent;
|
||||
|
||||
private:
|
||||
// Promises used only for the base-class (sync->async adapter) implementation
|
||||
// of Request{Audio,Video}Data.
|
||||
|
@ -814,10 +814,11 @@ bool OggReader::ReadOggChain()
|
||||
if (chained) {
|
||||
SetChained(true);
|
||||
{
|
||||
nsAutoPtr<MediaInfo> info(new MediaInfo(mInfo));
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
auto t = mDecodedAudioFrames * USECS_PER_S / mInfo.mAudio.mRate;
|
||||
mDecoder->QueueMetadata(media::TimeUnit::FromMicroseconds(t), info, tags);
|
||||
mTimedMetadataEvent.Notify(
|
||||
TimedMetadata(media::TimeUnit::FromMicroseconds(t),
|
||||
Move(tags),
|
||||
nsAutoPtr<MediaInfo>(new MediaInfo(mInfo))));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user