diff --git a/packager/app/test/packager_test.py b/packager/app/test/packager_test.py
index cec5d39419..7ca99205d0 100755
--- a/packager/app/test/packager_test.py
+++ b/packager/app/test/packager_test.py
@@ -122,6 +122,15 @@ class PackagerAppTest(unittest.TestCase):
self._DiffGold(self.output[0], 'bear-320x240-vp9-golden.webm')
self._DiffGold(self.mpd_output, 'bear-320x240-vp9-webm-golden.mpd')
+ def testPackageVorbisWebm(self):
+ self.packager.Package(
+ self._GetStreams(['audio'],
+ output_format='webm',
+ test_files=['bear-320x240-audio-only.webm']),
+ self._GetFlags())
+ self._DiffGold(self.output[0], 'bear-320x240-vorbis-golden.webm')
+ self._DiffGold(self.mpd_output, 'bear-320x240-vorbis-webm-golden.mpd')
+
def testPackageWithEncryption(self):
self.packager.Package(
self._GetStreams(['audio', 'video']),
diff --git a/packager/app/test/testdata/bear-320x240-vorbis-golden.webm b/packager/app/test/testdata/bear-320x240-vorbis-golden.webm
new file mode 100644
index 0000000000..37237b9638
Binary files /dev/null and b/packager/app/test/testdata/bear-320x240-vorbis-golden.webm differ
diff --git a/packager/app/test/testdata/bear-320x240-vorbis-webm-golden.mpd b/packager/app/test/testdata/bear-320x240-vorbis-webm-golden.mpd
new file mode 100644
index 0000000000..eec2c4edbf
--- /dev/null
+++ b/packager/app/test/testdata/bear-320x240-vorbis-webm-golden.mpd
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+ output_audio.webm
+
+
+
+
+
+
+
diff --git a/packager/app/test/testdata/bear-320x240-vp9-golden.webm b/packager/app/test/testdata/bear-320x240-vp9-golden.webm
index 14e818fb6d..9e34a62ab2 100644
Binary files a/packager/app/test/testdata/bear-320x240-vp9-golden.webm and b/packager/app/test/testdata/bear-320x240-vp9-golden.webm differ
diff --git a/packager/app/test/testdata/bear-320x240-vp9-webm-golden.mpd b/packager/app/test/testdata/bear-320x240-vp9-webm-golden.mpd
index 3d694dcc64..2576c0f67c 100644
--- a/packager/app/test/testdata/bear-320x240-vp9-webm-golden.mpd
+++ b/packager/app/test/testdata/bear-320x240-vp9-webm-golden.mpd
@@ -3,10 +3,10 @@
-
+
output_video.webm
-
-
+
+
diff --git a/packager/app/test/testdata/bear-640x360-vp8-golden.webm b/packager/app/test/testdata/bear-640x360-vp8-golden.webm
index 6acb9f52ed..330354f702 100644
Binary files a/packager/app/test/testdata/bear-640x360-vp8-golden.webm and b/packager/app/test/testdata/bear-640x360-vp8-golden.webm differ
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 b6a0dc49e9..3a427670ff 100644
--- a/packager/app/test/testdata/bear-640x360-vp8-webm-golden.mpd
+++ b/packager/app/test/testdata/bear-640x360-vp8-webm-golden.mpd
@@ -3,10 +3,10 @@
-
+
output_video.webm
-
-
+
+
diff --git a/packager/media/formats/webm/segmenter.cc b/packager/media/formats/webm/segmenter.cc
index bed96e0f45..764e1bc6df 100644
--- a/packager/media/formats/webm/segmenter.cc
+++ b/packager/media/formats/webm/segmenter.cc
@@ -249,13 +249,14 @@ Status Segmenter::CreateVideoTrack(VideoStreamInfo* info) {
}
track->set_uid(info->track_id());
+ if (!info->language().empty())
+ track->set_language(info->language().c_str());
track->set_type(mkvmuxer::Tracks::kVideo);
track->set_width(info->width());
track->set_height(info->height());
track->set_display_height(info->height());
track->set_display_width(info->width() * info->pixel_width() /
info->pixel_height());
- track->set_language(info->language().c_str());
tracks_.AddTrack(track, info->track_id());
track_id_ = track->number();
@@ -278,9 +279,15 @@ Status Segmenter::CreateAudioTrack(AudioStreamInfo* info) {
return Status(error::UNIMPLEMENTED,
"Only Vorbis and Opus audio codecs are supported.");
}
+ if (!track->SetCodecPrivate(info->extra_data().data(),
+ info->extra_data().size())) {
+ return Status(error::INTERNAL_ERROR,
+ "Private codec data required for audio streams");
+ }
track->set_uid(info->track_id());
- track->set_language(info->language().c_str());
+ if (!info->language().empty())
+ track->set_language(info->language().c_str());
track->set_type(mkvmuxer::Tracks::kAudio);
track->set_sample_rate(info->sampling_frequency());
track->set_channels(info->num_channels());