Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
V
V8
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
V8
Commits
eb27317c
Commit
eb27317c
authored
Dec 12, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deal with corner case.
parent
e7038fbd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
builtins-encoder.cc
src/builtins/builtins-encoder.cc
+13
-1
No files found.
src/builtins/builtins-encoder.cc
View file @
eb27317c
...
@@ -141,7 +141,6 @@ BUILTIN(Close) {
...
@@ -141,7 +141,6 @@ BUILTIN(Close) {
return
*
isolate
->
factory
()
->
ToBoolean
(
true
);
return
*
isolate
->
factory
()
->
ToBoolean
(
true
);
}
}
std
::
remove
(
enc
->
getOutputPath
().
c_str
());
enc
->
close
();
enc
->
close
();
enc
=
nullptr
;
enc
=
nullptr
;
inited
=
false
;
inited
=
false
;
...
@@ -225,6 +224,12 @@ BUILTIN(Save) {
...
@@ -225,6 +224,12 @@ BUILTIN(Save) {
BUILTIN
(
AddAudioBuffer
)
{
BUILTIN
(
AddAudioBuffer
)
{
HandleScope
scope
(
isolate
);
HandleScope
scope
(
isolate
);
Handle
<
Object
>
audioBuffer
=
args
.
atOrUndefined
(
isolate
,
1
);
if
(
audioBuffer
->
IsUndefined
()
||
audioBuffer
->
IsNull
())
{
return
ReadOnlyRoots
(
isolate
).
undefined_value
();
}
Handle
<
JSTypedArray
>
array
;
Handle
<
JSTypedArray
>
array
;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION
(
isolate
,
array
,
ASSIGN_RETURN_FAILURE_ON_EXCEPTION
(
isolate
,
array
,
JSTypedArray
::
Validate
(
isolate
,
args
.
atOrUndefined
(
isolate
,
1
),
"ENCODER.encode()"
));
JSTypedArray
::
Validate
(
isolate
,
args
.
atOrUndefined
(
isolate
,
1
),
"ENCODER.encode()"
));
...
@@ -252,7 +257,13 @@ BUILTIN(AddAudioBuffer) {
...
@@ -252,7 +257,13 @@ BUILTIN(AddAudioBuffer) {
BUILTIN
(
MergeMP4
)
{
BUILTIN
(
MergeMP4
)
{
HandleScope
scope
(
isolate
);
HandleScope
scope
(
isolate
);
if
(
!
audioPath
)
{
return
*
(
isolate
->
factory
()
->
NewStringFromAsciiChecked
(
enc
->
getOutputPath
().
c_str
()));
}
Handle
<
Object
>
libpath
=
args
.
atOrUndefined
(
isolate
,
1
);
Handle
<
Object
>
libpath
=
args
.
atOrUndefined
(
isolate
,
1
);
// Libav path
// Libav path
std
::
string
libpath_cppstr
;
std
::
string
libpath_cppstr
;
if
(
libpath
->
IsUndefined
())
{
if
(
libpath
->
IsUndefined
())
{
...
@@ -284,6 +295,7 @@ BUILTIN(MergeMP4) {
...
@@ -284,6 +295,7 @@ BUILTIN(MergeMP4) {
free
(
audioPath
);
free
(
audioPath
);
audioPath
=
nullptr
;
audioPath
=
nullptr
;
std
::
remove
(
enc
->
getOutputPath
().
c_str
());
return
*
mergepath
;
return
*
mergepath
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment