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
60a9cc58
Commit
60a9cc58
authored
Mar 16, 2006
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep ftyp first
Originally committed as revision 5170 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
c0339599
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
qt-faststart.c
qt-faststart.c
+36
-0
No files found.
qt-faststart.c
View file @
60a9cc58
...
...
@@ -72,10 +72,13 @@ int main(int argc, char *argv[])
uint64_t
atom_size
=
0
;
uint64_t
last_offset
;
unsigned
char
*
moov_atom
;
unsigned
char
*
ftyp_atom
=
0
;
uint64_t
moov_atom_size
;
uint64_t
ftyp_atom_size
=
0
;
uint64_t
i
,
j
;
uint32_t
offset_count
;
uint64_t
current_offset
;
uint64_t
start_offset
=
0
;
unsigned
char
copy_buffer
[
COPY_BUFFER_SIZE
];
int
bytes_to_copy
;
...
...
@@ -112,6 +115,27 @@ int main(int argc, char *argv[])
break
;
}
/* keep ftyp atom */
if
(
atom_type
==
FTYP_ATOM
)
{
ftyp_atom_size
=
atom_size
;
ftyp_atom
=
malloc
(
ftyp_atom_size
);
if
(
!
ftyp_atom
)
{
printf
(
"could not allocate 0x%llX byte for ftyp atom
\n
"
,
atom_size
);
fclose
(
infile
);
return
1
;
}
fseeko
(
infile
,
-
ATOM_PREAMBLE_SIZE
,
SEEK_CUR
);
if
(
fread
(
ftyp_atom
,
atom_size
,
1
,
infile
)
!=
1
)
{
perror
(
argv
[
1
]);
free
(
ftyp_atom
);
fclose
(
infile
);
return
1
;
}
start_offset
=
ftello
(
infile
);
continue
;
}
/* 64-bit special case */
if
(
atom_size
==
1
)
{
if
(
fread
(
atom_bytes
,
ATOM_PREAMBLE_SIZE
,
1
,
infile
)
!=
1
)
{
...
...
@@ -214,6 +238,9 @@ int main(int argc, char *argv[])
free
(
moov_atom
);
return
1
;
}
/* seek after ftyp atom if needed */
fseeko
(
infile
,
start_offset
,
SEEK_SET
);
outfile
=
fopen
(
argv
[
2
],
"wb"
);
if
(
!
outfile
)
{
perror
(
argv
[
2
]);
...
...
@@ -222,6 +249,15 @@ int main(int argc, char *argv[])
return
1
;
}
/* dump the same ftyp atom */
if
(
ftyp_atom_size
>
0
)
{
printf
(
" writing ftyp atom...
\n
"
);
if
(
fwrite
(
ftyp_atom
,
ftyp_atom_size
,
1
,
outfile
)
!=
1
)
{
perror
(
argv
[
2
]);
goto
error_out
;
}
}
/* dump the new moov atom */
printf
(
" writing moov atom...
\n
"
);
if
(
fwrite
(
moov_atom
,
moov_atom_size
,
1
,
outfile
)
!=
1
)
{
...
...
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