From 86a86ce954ed155590efa5be38e3b47e9bf76e8c Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Fri, 20 Jul 2018 13:27:38 -0700 Subject: [PATCH] Return an error with '$' in stream output for WebVTT WebVTT output with one file per Representatin per Period is not supported yet. Bug: 111359775. Change-Id: I63f8dbbd65e6e286778474175d33f337f2a758ae --- packager/packager.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packager/packager.cc b/packager/packager.cc index 97e5049594..df81c3ac36 100644 --- a/packager/packager.cc +++ b/packager/packager.cc @@ -197,13 +197,6 @@ Status ValidateStreamDescriptor(bool dump_stream_info, RETURN_IF_ERROR(ValidateSegmentTemplate(stream.segment_template)); } - if (stream.output.find('$') != std::string::npos) { - // "$" is only allowed if the output file name is a template, which is - // used to support one file per Representation per Period when there are - // Ad Cues. - RETURN_IF_ERROR(ValidateSegmentTemplate(stream.output)); - } - // There are some specifics that must be checked based on which format // we are writing to. const MediaContainerName output_format = GetOutputFormat(stream); @@ -248,6 +241,20 @@ Status ValidateStreamDescriptor(bool dump_stream_info, } } + if (stream.output.find('$') != std::string::npos) { + if (output_format == CONTAINER_WEBVTT) { + return Status( + error::UNIMPLEMENTED, + "WebVTT output with one file per Representation per Period " + "is not supported yet. Please use fMP4 instead. If that needs to be " + "supported, please file a feature request on GitHub."); + } + // "$" is only allowed if the output file name is a template, which is + // used to support one file per Representation per Period when there are + // Ad Cues. + RETURN_IF_ERROR(ValidateSegmentTemplate(stream.output)); + } + return Status::OK; }