From 4194f0746e38d3fd0ba4b547630dc00b0c15f0b9 Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Mon, 29 Jan 2018 11:04:09 -0800 Subject: [PATCH] [DASH][WebM] Fix subsegmentAlignment not set problem MuxerListener::OnNewSegment was not sent for WebM SingleSegmentSegmenter. Change-Id: Iecae84e7a7c1a8a4d3f577158fa286b9c9959934 --- .../app/test/testdata/bear-320x240-vorbis-webm-golden.mpd | 2 +- .../app/test/testdata/bear-320x240-vp9-opus-webm-golden.mpd | 4 ++-- .../app/test/testdata/bear-640x360-vp8-cenc-webm-golden.mpd | 2 +- packager/app/test/testdata/bear-640x360-vp8-webm-golden.mpd | 2 +- packager/media/formats/webm/single_segment_segmenter.cc | 6 ++++++ 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packager/app/test/testdata/bear-320x240-vorbis-webm-golden.mpd b/packager/app/test/testdata/bear-320x240-vorbis-webm-golden.mpd index d2fb244afc..8f8784be96 100644 --- a/packager/app/test/testdata/bear-320x240-vorbis-webm-golden.mpd +++ b/packager/app/test/testdata/bear-320x240-vorbis-webm-golden.mpd @@ -2,7 +2,7 @@ - + output_audio.webm diff --git a/packager/app/test/testdata/bear-320x240-vp9-opus-webm-golden.mpd b/packager/app/test/testdata/bear-320x240-vp9-opus-webm-golden.mpd index 8a22b035a1..4b34ee862f 100644 --- a/packager/app/test/testdata/bear-320x240-vp9-opus-webm-golden.mpd +++ b/packager/app/test/testdata/bear-320x240-vp9-opus-webm-golden.mpd @@ -2,7 +2,7 @@ - + output_audio.webm @@ -11,7 +11,7 @@ - + output_video.webm diff --git a/packager/app/test/testdata/bear-640x360-vp8-cenc-webm-golden.mpd b/packager/app/test/testdata/bear-640x360-vp8-cenc-webm-golden.mpd index fd1217f61b..0354738a2d 100644 --- a/packager/app/test/testdata/bear-640x360-vp8-cenc-webm-golden.mpd +++ b/packager/app/test/testdata/bear-640x360-vp8-cenc-webm-golden.mpd @@ -2,7 +2,7 @@ - + AAAANHBzc2gBAAAAEHfv7MCyTQKs4zweUuL7SwAAAAExMjM0NTY3ODkwMTIzNDU2AAAAAA== diff --git a/packager/app/test/testdata/bear-640x360-vp8-webm-golden.mpd b/packager/app/test/testdata/bear-640x360-vp8-webm-golden.mpd index 4622bff4c9..f177a945ff 100644 --- a/packager/app/test/testdata/bear-640x360-vp8-webm-golden.mpd +++ b/packager/app/test/testdata/bear-640x360-vp8-webm-golden.mpd @@ -2,7 +2,7 @@ - + output_video.webm diff --git a/packager/media/formats/webm/single_segment_segmenter.cc b/packager/media/formats/webm/single_segment_segmenter.cc index ead19d3f99..29a6be7572 100644 --- a/packager/media/formats/webm/single_segment_segmenter.cc +++ b/packager/media/formats/webm/single_segment_segmenter.cc @@ -7,6 +7,7 @@ #include "packager/media/formats/webm/single_segment_segmenter.h" #include "packager/media/base/muxer_options.h" +#include "packager/media/event/muxer_listener.h" #include "packager/third_party/libwebm/src/mkvmuxer.hpp" namespace shaka { @@ -31,6 +32,11 @@ Status SingleSegmentSegmenter::FinalizeSegment(uint64_t start_timestamp, CHECK(cluster()); if (!cluster()->Finalize()) return Status(error::FILE_FAILURE, "Error finalizing cluster."); + if (muxer_listener()) { + const uint64_t size = cluster()->Size(); + muxer_listener()->OnNewSegment(options().output_file_name, start_timestamp, + duration_timestamp, size); + } return Status::OK; }