Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write to memory file before writing to file for WebM segments generation. #803

Merged
merged 3 commits into from
Jul 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Addressing comments in the PR 2.
  • Loading branch information
sr1990 committed Jul 24, 2020
commit 7c9337cfbeee73fed0fff4ac15392a4e5259fbf9
6 changes: 3 additions & 3 deletions packager/media/formats/webm/multi_segment_segmenter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ Status MultiSegmentSegmenter::NewSegment(uint64_t start_timestamp,
bool is_subsegment) {
if (!is_subsegment) {
temp_file_name_ =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be either a memory file (prefix with "memory://") or an actual temporary file:

  if (!TempFilePath(options().temp_dir, &temp_file_name_))
    return Status(error::FILE_FAILURE, "Unable to create temporary file.");

This is because options().segment_template could be a remote file, e.g. HttpFile. We don't want to create a temporary file there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that. I have made the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kqyang Do you want to change temp_file_name_ to memory_file_name_?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. It is fine with me. Thanks.

GetSegmentName(options().segment_template, start_timestamp,
num_segment_, options().bandwidth) +
"_temp";
"memory://" + GetSegmentName(options().segment_template,
start_timestamp, num_segment_,
options().bandwidth);

writer_.reset(new MkvWriter);
Status status = writer_->Open(temp_file_name_);
Expand Down