Bug 1257318: Pass TRACK_EVENT_ENDED events through to the TrackEncoders r=padenot a=ritu
authorRandell Jesup <rjesup@jesup.org>
Sat, 19 Mar 2016 10:37:42 -0400
changeset 325536 d9c81b59d63cb2869b9cd4bcc0d30dde5f51ae76
parent 325535 99dc7c2f51eb03463f2f60e7fc2f9e0e7c579ca9
child 325537 d6257152dcbf8ff8c46ce70331410315cd6a4b9a
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, ritu
bugs1257318
milestone47.0a2
Bug 1257318: Pass TRACK_EVENT_ENDED events through to the TrackEncoders r=padenot a=ritu MozReview-Commit-ID: 4b6p27YrHEw
dom/media/encoder/MediaEncoder.cpp
--- a/dom/media/encoder/MediaEncoder.cpp
+++ b/dom/media/encoder/MediaEncoder.cpp
@@ -73,16 +73,26 @@ MediaEncoder::NotifyQueuedTrackChanges(M
                                        uint32_t aTrackEvents,
                                        const MediaSegment& aQueuedMedia,
                                        MediaStream* aInputStream,
                                        TrackID aInputTrackID)
 {
   if (!mDirectConnected) {
     NotifyRealtimeData(aGraph, aID, aTrackOffset, aTrackEvents, aQueuedMedia);
   } else {
+    if (aTrackEvents != 0) {
+      // forward events (TRACK_EVENT_ENDED) but not the media
+      if (aQueuedMedia.GetType() == MediaSegment::VIDEO) {
+        VideoSegment segment;
+        NotifyRealtimeData(aGraph, aID, aTrackOffset, aTrackEvents, segment);
+      } else {
+        AudioSegment segment;
+        NotifyRealtimeData(aGraph, aID, aTrackOffset, aTrackEvents, segment);
+      }
+    }
     if (mSuspended == RECORD_RESUMED) {
       if (mVideoEncoder) {
         if (aQueuedMedia.GetType() == MediaSegment::VIDEO) {
           // insert a null frame of duration equal to the first segment passed
           // after Resume(), so it'll get added to one of the DirectListener frames
           VideoSegment segment;
           gfx::IntSize size(0,0);
           segment.AppendFrame(nullptr, aQueuedMedia.GetDuration(), size);