Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
ffmpeg.wasm-core
Commits
25e35b34
Commit
25e35b34
authored
Nov 11, 2016
by
Chen Meng
Committed by
Michael Niedermayer
Dec 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mov.: Make the process of uuid-xmp atom faster.
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
4240e5b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
mov.c
libavformat/mov.c
+18
-14
No files found.
libavformat/mov.c
View file @
25e35b34
...
...
@@ -4776,24 +4776,28 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
}
else
if
(
!
memcmp
(
uuid
,
uuid_xmp
,
sizeof
(
uuid
)))
{
uint8_t
*
buffer
;
size_t
len
=
atom
.
size
-
sizeof
(
uuid
);
buffer
=
av_mallocz
(
len
+
1
);
if
(
!
buffer
)
{
return
AVERROR
(
ENOMEM
);
}
ret
=
avio_read
(
pb
,
buffer
,
len
);
if
(
ret
<
0
)
{
av_free
(
buffer
);
return
ret
;
}
else
if
(
ret
!=
len
)
{
av_free
(
buffer
);
return
AVERROR_INVALIDDATA
;
}
if
(
c
->
export_xmp
)
{
buffer
=
av_mallocz
(
len
+
1
);
if
(
!
buffer
)
{
return
AVERROR
(
ENOMEM
);
}
ret
=
avio_read
(
pb
,
buffer
,
len
);
if
(
ret
<
0
)
{
av_free
(
buffer
);
return
ret
;
}
else
if
(
ret
!=
len
)
{
av_free
(
buffer
);
return
AVERROR_INVALIDDATA
;
}
buffer
[
len
]
=
'\0'
;
av_dict_set
(
&
c
->
fc
->
metadata
,
"xmp"
,
buffer
,
0
);
av_free
(
buffer
);
}
else
{
// skip all uuid atom, which makes it fast for long uuid-xmp file
ret
=
avio_skip
(
pb
,
len
);
if
(
ret
<
0
)
return
ret
;
}
av_free
(
buffer
);
}
else
if
(
!
memcmp
(
uuid
,
uuid_spherical
,
sizeof
(
uuid
)))
{
size_t
len
=
atom
.
size
-
sizeof
(
uuid
);
ret
=
mov_parse_uuid_spherical
(
sc
,
pb
,
len
);
...
...
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