From d9124d6aaaca6574319af0ab73d44d059c556e3c Mon Sep 17 00:00:00 2001 From: Vishal Shah Date: Tue, 4 May 2021 22:57:43 -0700 Subject: [PATCH] [WEBVTT] Fix missing text alignment tags from output Legacy players, e.g. older versions of ExoPlayer, do not handle default webvtt text alignment correctly. Need to specify `align:center` explicitly cues without text alignment for backwards compatibility. Fixes #925. --- .../bear-english-text.vtt | 4 ++-- .../output.mpd | 2 +- .../bear-english-text-1.vtt | 2 +- .../bear-english-text-2.vtt | 2 +- .../bear-english-text-3.vtt | 2 +- .../bear-english-text-4.vtt | 2 +- .../bear-english-text-5.vtt | 2 +- .../bear-english-text-6.vtt | 2 +- .../bear-english-text-1.m4s | Bin 243 -> 263 bytes .../bear-english-text-1.vtt | 2 +- .../bear-english-text-2.m4s | Bin 241 -> 261 bytes .../bear-english-text-2.vtt | 2 +- .../bear-english-text-3.m4s | Bin 241 -> 261 bytes .../bear-english-text-3.vtt | 2 +- .../bear-english-text-4.m4s | Bin 241 -> 261 bytes .../bear-english-text-4.vtt | 2 +- .../bear-english-text-5.m4s | Bin 257 -> 277 bytes .../bear-english-text-5.vtt | 2 +- .../hls-only-dash-only-captions/output.mpd | 2 +- .../bear-english-text-1.vtt | 2 +- .../bear-english-text-2.vtt | 2 +- .../bear-english-text-3.vtt | 2 +- .../bear-english-text-4.vtt | 2 +- .../bear-english-text-5.vtt | 2 +- .../bear-english-text-1.m4s | Bin 243 -> 263 bytes .../bear-english-text-2.m4s | Bin 241 -> 261 bytes .../bear-english-text-3.m4s | Bin 241 -> 261 bytes .../bear-english-text-4.m4s | Bin 241 -> 261 bytes .../bear-english-text-5.m4s | Bin 257 -> 277 bytes .../testdata/segmented-webvtt-mp4/output.mpd | 2 +- .../bear-english-text-1.vtt | 2 +- .../bear-english-text-2.vtt | 2 +- .../bear-english-text-3.vtt | 2 +- .../bear-english-text-4.vtt | 2 +- .../bear-english-text-5.vtt | 2 +- .../testdata/segmented-webvtt-text/output.mpd | 2 +- .../bear-english-text-1.m4s | Bin 243 -> 263 bytes .../bear-english-text-1.vtt | 2 +- .../bear-english-text-2.m4s | Bin 241 -> 261 bytes .../bear-english-text-2.vtt | 2 +- .../bear-english-text-3.m4s | Bin 241 -> 261 bytes .../bear-english-text-3.vtt | 2 +- .../bear-english-text-4.m4s | Bin 241 -> 261 bytes .../bear-english-text-4.vtt | 2 +- .../bear-english-text-5.m4s | Bin 257 -> 277 bytes .../bear-english-text-5.vtt | 2 +- .../output.mpd | 2 +- .../bear-english-text.vtt | 4 ++-- .../testdata/single-file-webvtt-text/output.mpd | 2 +- .../video-audio-webvtt/bear-english-text.vtt | 4 ++-- .../test/testdata/video-audio-webvtt/output.mpd | 2 +- .../bear-english-text-1.m4s | Bin 243 -> 263 bytes .../bear-english-text-2.m4s | Bin 241 -> 261 bytes .../bear-english-text-3.m4s | Bin 241 -> 261 bytes .../bear-english-text-4.m4s | Bin 241 -> 261 bytes .../bear-english-text-5.m4s | Bin 241 -> 261 bytes .../bear-english-text-6.m4s | Bin 257 -> 277 bytes .../vtt-text-to-mp4-with-ad-cues/output.mpd | 4 ++-- .../formats/webvtt/webvtt_muxer_unittest.cc | 8 ++++---- packager/media/formats/webvtt/webvtt_utils.cc | 1 + .../formats/webvtt/webvtt_utils_unittest.cc | 3 ++- 61 files changed, 48 insertions(+), 46 deletions(-) diff --git a/packager/app/test/testdata/audio-video-with-accessibilities-and-roles/bear-english-text.vtt b/packager/app/test/testdata/audio-video-with-accessibilities-and-roles/bear-english-text.vtt index 30e81dfea0..18ae752fe8 100644 --- a/packager/app/test/testdata/audio-video-with-accessibilities-and-roles/bear-english-text.vtt +++ b/packager/app/test/testdata/audio-video-with-accessibilities-and-roles/bear-english-text.vtt @@ -3,9 +3,9 @@ WEBVTT STYLE ::cue { color:lime } -00:00:00.000 --> 00:00:00.800 +00:00:00.000 --> 00:00:00.800 align:center Yup, that's a bear, eh. -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/audio-video-with-accessibilities-and-roles/output.mpd b/packager/app/test/testdata/audio-video-with-accessibilities-and-roles/output.mpd index c6de0c9286..958ec27b1d 100644 --- a/packager/app/test/testdata/audio-video-with-accessibilities-and-roles/output.mpd +++ b/packager/app/test/testdata/audio-video-with-accessibilities-and-roles/output.mpd @@ -23,7 +23,7 @@ - + bear-english-text.vtt diff --git a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-1.vtt b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-1.vtt index cd7ad3d7bd..d436f57266 100644 --- a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-1.vtt +++ b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-1.vtt @@ -3,6 +3,6 @@ WEBVTT STYLE ::cue { color:lime } -00:00:00.000 --> 00:00:00.800 +00:00:00.000 --> 00:00:00.800 align:center Yup, that's a bear, eh. diff --git a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-2.vtt b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-2.vtt index ae16c7bd9a..a2dc27b707 100644 --- a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-2.vtt +++ b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-2.vtt @@ -3,6 +3,6 @@ WEBVTT STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-3.vtt b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-3.vtt index ae16c7bd9a..a2dc27b707 100644 --- a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-3.vtt +++ b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-3.vtt @@ -3,6 +3,6 @@ WEBVTT STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-4.vtt b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-4.vtt index ae16c7bd9a..a2dc27b707 100644 --- a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-4.vtt +++ b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-4.vtt @@ -3,6 +3,6 @@ WEBVTT STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-5.vtt b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-5.vtt index ae16c7bd9a..a2dc27b707 100644 --- a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-5.vtt +++ b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-5.vtt @@ -3,6 +3,6 @@ WEBVTT STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-6.vtt b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-6.vtt index ae16c7bd9a..a2dc27b707 100644 --- a/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-6.vtt +++ b/packager/app/test/testdata/hls-audio-video-text-with-ad-cues/bear-english-text-6.vtt @@ -3,6 +3,6 @@ WEBVTT STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-1.m4s b/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-1.m4s index 7f6fea5f0301b5140ec26bede2b97e8ca57b12d4..9ce5e4e24fdc0310ac08d2969ef20b84bc692b9a 100644 GIT binary patch delta 60 zcmey&*v>S;opJj_k8E9Q1_p)`K+FNe-nl7>B|zG`tfV9vNQ)Ggl%yx-WTxj?C8y?< Kq!vv)qYeP;6cLsH delta 40 rcmZo?`ph`NopJF*k8DYG1_p)`K+FNe=D8_}B|uuetfVA);sbR6*7gdj diff --git a/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-1.vtt b/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-1.vtt index cd7ad3d7bd..d436f57266 100644 --- a/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-1.vtt +++ b/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-1.vtt @@ -3,6 +3,6 @@ WEBVTT STYLE ::cue { color:lime } -00:00:00.000 --> 00:00:00.800 +00:00:00.000 --> 00:00:00.800 align:center Yup, that's a bear, eh. diff --git a/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-2.m4s b/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-2.m4s index a59e2a79add424b7aa7307d6577b63fbc9931d2b..119b4f5ada40472643afbdda010342a95ca2b069 100644 GIT binary patch delta 53 zcmey!*vd4)opI|#4`)Wti9Onifw?J(B@7G 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-3.m4s b/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-3.m4s index 08140209f9e829b7e4888d39439138e7b6f8d64f..6e047989961812da6d5e52b3e5a8623b7f18d32e 100644 GIT binary patch delta 53 zcmey!*vd4)opI|#4`)Wti9Onifw?J(B@7G 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-4.m4s b/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-4.m4s index 666cbc3c1ed710944b034430a5cbd1993f25725f..48c319aea7c0d1b241e142dc43071f5e244c15ac 100644 GIT binary patch delta 53 zcmey!*vd4)opI|#4`)Wti9Onifw?J(B@7G 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-5.m4s b/packager/app/test/testdata/hls-only-dash-only-captions/bear-english-text-5.m4s index 5c8f82c5da402b4ecbd1634ce793eae6566bb949..7f77e260ea41f14868b57b9b57b704e0c099085d 100644 GIT binary patch delta 60 zcmZo17Nh|@ 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-only-dash-only-captions/output.mpd b/packager/app/test/testdata/hls-only-dash-only-captions/output.mpd index 1644042a48..2efb24609d 100644 --- a/packager/app/test/testdata/hls-only-dash-only-captions/output.mpd +++ b/packager/app/test/testdata/hls-only-dash-only-captions/output.mpd @@ -26,7 +26,7 @@ - + diff --git a/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-1.vtt b/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-1.vtt index 0e343feb32..cb9ac12df0 100644 --- a/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-1.vtt +++ b/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-1.vtt @@ -4,6 +4,6 @@ X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:9000 STYLE ::cue { color:lime } -00:00:00.000 --> 00:00:00.800 +00:00:00.000 --> 00:00:00.800 align:center Yup, that's a bear, eh. diff --git a/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-2.vtt b/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-2.vtt index 8597f536ab..c4d88d32b7 100644 --- a/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-2.vtt +++ b/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-2.vtt @@ -4,6 +4,6 @@ X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:9000 STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-3.vtt b/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-3.vtt index 8597f536ab..c4d88d32b7 100644 --- a/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-3.vtt +++ b/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-3.vtt @@ -4,6 +4,6 @@ X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:9000 STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-4.vtt b/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-4.vtt index 8597f536ab..c4d88d32b7 100644 --- a/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-4.vtt +++ b/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-4.vtt @@ -4,6 +4,6 @@ X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:9000 STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-5.vtt b/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-5.vtt index 8597f536ab..c4d88d32b7 100644 --- a/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-5.vtt +++ b/packager/app/test/testdata/hls-segmented-webvtt/bear-english-text-5.vtt @@ -4,6 +4,6 @@ X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:9000 STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/segmented-webvtt-mp4/bear-english-text-1.m4s b/packager/app/test/testdata/segmented-webvtt-mp4/bear-english-text-1.m4s index 7f6fea5f0301b5140ec26bede2b97e8ca57b12d4..9ce5e4e24fdc0310ac08d2969ef20b84bc692b9a 100644 GIT binary patch delta 60 zcmey&*v>S;opJj_k8E9Q1_p)`K+FNe-nl7>B|zG`tfV9vNQ)Ggl%yx-WTxj?C8y?< Kq!vv)qYeP;6cLsH delta 40 rcmZo?`ph`NopJF*k8DYG1_p)`K+FNe=D8_}B|uuetfVA);sbR6*7gdj diff --git a/packager/app/test/testdata/segmented-webvtt-mp4/bear-english-text-2.m4s b/packager/app/test/testdata/segmented-webvtt-mp4/bear-english-text-2.m4s index a59e2a79add424b7aa7307d6577b63fbc9931d2b..119b4f5ada40472643afbdda010342a95ca2b069 100644 GIT binary patch delta 53 zcmey!*vd4)opI|#4`)Wti9Onifw?J(B@7G17Nh|@ - + diff --git a/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-1.vtt b/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-1.vtt index 0e343feb32..cb9ac12df0 100644 --- a/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-1.vtt +++ b/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-1.vtt @@ -4,6 +4,6 @@ X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:9000 STYLE ::cue { color:lime } -00:00:00.000 --> 00:00:00.800 +00:00:00.000 --> 00:00:00.800 align:center Yup, that's a bear, eh. diff --git a/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-2.vtt b/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-2.vtt index 8597f536ab..c4d88d32b7 100644 --- a/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-2.vtt +++ b/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-2.vtt @@ -4,6 +4,6 @@ X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:9000 STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-3.vtt b/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-3.vtt index 8597f536ab..c4d88d32b7 100644 --- a/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-3.vtt +++ b/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-3.vtt @@ -4,6 +4,6 @@ X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:9000 STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-4.vtt b/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-4.vtt index 8597f536ab..c4d88d32b7 100644 --- a/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-4.vtt +++ b/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-4.vtt @@ -4,6 +4,6 @@ X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:9000 STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-5.vtt b/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-5.vtt index 8597f536ab..c4d88d32b7 100644 --- a/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-5.vtt +++ b/packager/app/test/testdata/segmented-webvtt-text/bear-english-text-5.vtt @@ -4,6 +4,6 @@ X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:9000 STYLE ::cue { color:lime } -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/segmented-webvtt-text/output.mpd b/packager/app/test/testdata/segmented-webvtt-text/output.mpd index 78c74aa517..dd4aa441d3 100644 --- a/packager/app/test/testdata/segmented-webvtt-text/output.mpd +++ b/packager/app/test/testdata/segmented-webvtt-text/output.mpd @@ -4,7 +4,7 @@ - + diff --git a/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-1.m4s b/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-1.m4s index 7f6fea5f0301b5140ec26bede2b97e8ca57b12d4..9ce5e4e24fdc0310ac08d2969ef20b84bc692b9a 100644 GIT binary patch delta 60 zcmey&*v>S;opJj_k8E9Q1_p)`K+FNe-nl7>B|zG`tfV9vNQ)Ggl%yx-WTxj?C8y?< Kq!vv)qYeP;6cLsH delta 40 rcmZo?`ph`NopJF*k8DYG1_p)`K+FNe=D8_}B|uuetfVA);sbR6*7gdj diff --git a/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-1.vtt b/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-1.vtt index cd7ad3d7bd..d436f57266 100644 --- a/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-1.vtt +++ b/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-1.vtt @@ -3,6 +3,6 @@ WEBVTT STYLE ::cue { color:lime } -00:00:00.000 --> 00:00:00.800 +00:00:00.000 --> 00:00:00.800 align:center Yup, that's a bear, eh. diff --git a/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-2.m4s b/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-2.m4s index a59e2a79add424b7aa7307d6577b63fbc9931d2b..119b4f5ada40472643afbdda010342a95ca2b069 100644 GIT binary patch delta 53 zcmey!*vd4)opI|#4`)Wti9Onifw?J(B@7G 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-3.m4s b/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-3.m4s index 08140209f9e829b7e4888d39439138e7b6f8d64f..6e047989961812da6d5e52b3e5a8623b7f18d32e 100644 GIT binary patch delta 53 zcmey!*vd4)opI|#4`)Wti9Onifw?J(B@7G 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-4.m4s b/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-4.m4s index 666cbc3c1ed710944b034430a5cbd1993f25725f..48c319aea7c0d1b241e142dc43071f5e244c15ac 100644 GIT binary patch delta 53 zcmey!*vd4)opI|#4`)Wti9Onifw?J(B@7G 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-5.m4s b/packager/app/test/testdata/segmented-webvtt-with-language-override/bear-english-text-5.m4s index 5c8f82c5da402b4ecbd1634ce793eae6566bb949..7f77e260ea41f14868b57b9b57b704e0c099085d 100644 GIT binary patch delta 60 zcmZo17Nh|@ 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/segmented-webvtt-with-language-override/output.mpd b/packager/app/test/testdata/segmented-webvtt-with-language-override/output.mpd index ac0d53be9f..18e6002594 100644 --- a/packager/app/test/testdata/segmented-webvtt-with-language-override/output.mpd +++ b/packager/app/test/testdata/segmented-webvtt-with-language-override/output.mpd @@ -4,7 +4,7 @@ - + diff --git a/packager/app/test/testdata/single-file-webvtt-text/bear-english-text.vtt b/packager/app/test/testdata/single-file-webvtt-text/bear-english-text.vtt index 6f20be5417..b1a4829aa2 100644 --- a/packager/app/test/testdata/single-file-webvtt-text/bear-english-text.vtt +++ b/packager/app/test/testdata/single-file-webvtt-text/bear-english-text.vtt @@ -4,9 +4,9 @@ X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:9000 STYLE ::cue { color:lime } -00:00:00.000 --> 00:00:00.800 +00:00:00.000 --> 00:00:00.800 align:center Yup, that's a bear, eh. -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/single-file-webvtt-text/output.mpd b/packager/app/test/testdata/single-file-webvtt-text/output.mpd index e0317579b1..46291f3ef6 100644 --- a/packager/app/test/testdata/single-file-webvtt-text/output.mpd +++ b/packager/app/test/testdata/single-file-webvtt-text/output.mpd @@ -4,7 +4,7 @@ - + bear-english-text.vtt diff --git a/packager/app/test/testdata/video-audio-webvtt/bear-english-text.vtt b/packager/app/test/testdata/video-audio-webvtt/bear-english-text.vtt index 30e81dfea0..18ae752fe8 100644 --- a/packager/app/test/testdata/video-audio-webvtt/bear-english-text.vtt +++ b/packager/app/test/testdata/video-audio-webvtt/bear-english-text.vtt @@ -3,9 +3,9 @@ WEBVTT STYLE ::cue { color:lime } -00:00:00.000 --> 00:00:00.800 +00:00:00.000 --> 00:00:00.800 align:center Yup, that's a bear, eh. -00:00:01.000 --> 00:00:04.700 +00:00:01.000 --> 00:00:04.700 align:center He 's... um... doing bear-like stuff. diff --git a/packager/app/test/testdata/video-audio-webvtt/output.mpd b/packager/app/test/testdata/video-audio-webvtt/output.mpd index 2e57b85d86..d7ce2e3212 100644 --- a/packager/app/test/testdata/video-audio-webvtt/output.mpd +++ b/packager/app/test/testdata/video-audio-webvtt/output.mpd @@ -21,7 +21,7 @@ - + bear-english-text.vtt diff --git a/packager/app/test/testdata/vtt-text-to-mp4-with-ad-cues/bear-english-text-1.m4s b/packager/app/test/testdata/vtt-text-to-mp4-with-ad-cues/bear-english-text-1.m4s index 7f6fea5f0301b5140ec26bede2b97e8ca57b12d4..9ce5e4e24fdc0310ac08d2969ef20b84bc692b9a 100644 GIT binary patch delta 60 zcmey&*v>S;opJj_k8E9Q1_p)`K+FNe-nl7>B|zG`tfV9vNQ)Ggl%yx-WTxj?C8y?< Kq!vv)qYeP;6cLsH delta 40 rcmZo?`ph`NopJF*k8DYG1_p)`K+FNe=D8_}B|uuetfVA);sbR6*7gdj diff --git a/packager/app/test/testdata/vtt-text-to-mp4-with-ad-cues/bear-english-text-2.m4s b/packager/app/test/testdata/vtt-text-to-mp4-with-ad-cues/bear-english-text-2.m4s index a59e2a79add424b7aa7307d6577b63fbc9931d2b..119b4f5ada40472643afbdda010342a95ca2b069 100644 GIT binary patch delta 53 zcmey!*vd4)opI|#4`)Wti9Onifw?J(B@7G17Nh|@ - + @@ -56,7 +56,7 @@ - + diff --git a/packager/media/formats/webvtt/webvtt_muxer_unittest.cc b/packager/media/formats/webvtt/webvtt_muxer_unittest.cc index 16cbb356a8..77dd516c38 100644 --- a/packager/media/formats/webvtt/webvtt_muxer_unittest.cc +++ b/packager/media/formats/webvtt/webvtt_muxer_unittest.cc @@ -83,7 +83,7 @@ TEST_F(WebVttMuxerTest, WithOneSegmentAndWithOneSample) { const char* kExpectedOutput = "WEBVTT\n" "\n" - "00:00:05.000 --> 00:00:06.000\n" + "00:00:05.000 --> 00:00:06.000 align:center\n" "payload\n" "\n"; @@ -122,14 +122,14 @@ TEST_F(WebVttMuxerTest, WithTwoSegmentAndWithOneSample) { const char* kExpectedOutput1 = "WEBVTT\n" "\n" - "00:00:05.000 --> 00:00:06.000\n" + "00:00:05.000 --> 00:00:06.000 align:center\n" "payload 1\n" "\n"; const char* kExpectedOutput2 = "WEBVTT\n" "\n" - "00:00:15.000 --> 00:00:16.000\n" + "00:00:15.000 --> 00:00:16.000 align:center\n" "payload 2\n" "\n"; @@ -189,7 +189,7 @@ TEST_F(WebVttMuxerTest, WithAnEmptySegment) { const char* kExpectedOutput2 = "WEBVTT\n" "\n" - "00:00:15.000 --> 00:00:16.000\n" + "00:00:15.000 --> 00:00:16.000 align:center\n" "payload 2\n" "\n"; diff --git a/packager/media/formats/webvtt/webvtt_utils.cc b/packager/media/formats/webvtt/webvtt_utils.cc index 2d23ca5498..bb0bea3481 100644 --- a/packager/media/formats/webvtt/webvtt_utils.cc +++ b/packager/media/formats/webvtt/webvtt_utils.cc @@ -249,6 +249,7 @@ std::string WebVttSettingsToString(const TextSettings& settings) { ret += " align:right"; break; case TextAlignment::kCenter: + ret += " align:center"; break; } diff --git a/packager/media/formats/webvtt/webvtt_utils_unittest.cc b/packager/media/formats/webvtt/webvtt_utils_unittest.cc index bb405b9cb9..eb4281ef96 100644 --- a/packager/media/formats/webvtt/webvtt_utils_unittest.cc +++ b/packager/media/formats/webvtt/webvtt_utils_unittest.cc @@ -163,9 +163,10 @@ TEST(WebVttUtilsTest, SettingsToString) { TEST(WebVttUtilsTest, SettingsToString_IgnoresDefaults) { TextSettings settings; settings.region = "foo"; + settings.text_alignment = TextAlignment::kCenter; const auto actual = WebVttSettingsToString(settings); - EXPECT_EQ(actual, "region:foo"); + EXPECT_EQ(actual, "region:foo align:center"); } TEST(WebVttUtilsTest, FragmentToString) {