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
9f38fd7e
Commit
9f38fd7e
authored
Sep 05, 2007
by
David Conrad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make a byte always mean a byte
Originally committed as revision 10352 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
432adc13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
matroskaenc.c
libavformat/matroskaenc.c
+10
-10
No files found.
libavformat/matroskaenc.c
View file @
9f38fd7e
...
@@ -100,7 +100,7 @@ static void put_ebml_size_unknown(ByteIOContext *pb, int bytes)
...
@@ -100,7 +100,7 @@ static void put_ebml_size_unknown(ByteIOContext *pb, int bytes)
// use up all of the space reserved in start_ebml_master)
// use up all of the space reserved in start_ebml_master)
static
void
put_ebml_size
(
ByteIOContext
*
pb
,
uint64_t
size
,
int
minbytes
)
static
void
put_ebml_size
(
ByteIOContext
*
pb
,
uint64_t
size
,
int
minbytes
)
{
{
int
bytes
=
minbytes
;
int
i
,
bytes
=
minbytes
;
// sizes larger than this are currently undefined in EBML
// sizes larger than this are currently undefined in EBML
// so write "unknown" size
// so write "unknown" size
...
@@ -109,22 +109,22 @@ static void put_ebml_size(ByteIOContext *pb, uint64_t size, int minbytes)
...
@@ -109,22 +109,22 @@ static void put_ebml_size(ByteIOContext *pb, uint64_t size, int minbytes)
return
;
return
;
}
}
while
((
size
+
1
)
>>
(
bytes
*
7
+
7
)
)
bytes
++
;
while
((
size
+
1
)
>>
bytes
*
7
)
bytes
++
;
put_byte
(
pb
,
(
0x80
>>
bytes
)
|
(
size
>>
bytes
*
8
));
put_byte
(
pb
,
(
0x80
>>
(
bytes
-
1
))
|
(
size
>>
(
bytes
-
1
)
*
8
));
for
(
bytes
-=
1
;
bytes
>=
0
;
bytes
--
)
for
(
i
=
bytes
-
2
;
i
>=
0
;
i
--
)
put_byte
(
pb
,
size
>>
bytes
*
8
);
put_byte
(
pb
,
size
>>
i
*
8
);
}
}
static
void
put_ebml_uint
(
ByteIOContext
*
pb
,
unsigned
int
elementid
,
uint64_t
val
)
static
void
put_ebml_uint
(
ByteIOContext
*
pb
,
unsigned
int
elementid
,
uint64_t
val
)
{
{
int
bytes
=
1
;
int
i
,
bytes
=
1
;
while
(
val
>>
bytes
*
8
)
bytes
++
;
while
(
val
>>
bytes
*
8
)
bytes
++
;
put_ebml_id
(
pb
,
elementid
);
put_ebml_id
(
pb
,
elementid
);
put_ebml_size
(
pb
,
bytes
,
0
);
put_ebml_size
(
pb
,
bytes
,
0
);
for
(
bytes
-=
1
;
bytes
>=
0
;
bytes
--
)
for
(
i
=
bytes
-
1
;
i
>=
0
;
i
--
)
put_byte
(
pb
,
val
>>
bytes
*
8
);
put_byte
(
pb
,
val
>>
i
*
8
);
}
}
static
void
put_ebml_float
(
ByteIOContext
*
pb
,
unsigned
int
elementid
,
double
val
)
static
void
put_ebml_float
(
ByteIOContext
*
pb
,
unsigned
int
elementid
,
double
val
)
...
@@ -166,7 +166,7 @@ static void put_ebml_void(ByteIOContext *pb, uint64_t size)
...
@@ -166,7 +166,7 @@ static void put_ebml_void(ByteIOContext *pb, uint64_t size)
if
(
size
<
10
)
if
(
size
<
10
)
put_ebml_size
(
pb
,
size
-
1
,
0
);
put_ebml_size
(
pb
,
size
-
1
,
0
);
else
else
put_ebml_size
(
pb
,
size
-
9
,
7
);
put_ebml_size
(
pb
,
size
-
9
,
8
);
url_fseek
(
pb
,
currentpos
+
size
,
SEEK_SET
);
url_fseek
(
pb
,
currentpos
+
size
,
SEEK_SET
);
}
}
...
@@ -184,7 +184,7 @@ static void end_ebml_master(ByteIOContext *pb, offset_t start)
...
@@ -184,7 +184,7 @@ static void end_ebml_master(ByteIOContext *pb, offset_t start)
offset_t
pos
=
url_ftell
(
pb
);
offset_t
pos
=
url_ftell
(
pb
);
url_fseek
(
pb
,
start
-
8
,
SEEK_SET
);
url_fseek
(
pb
,
start
-
8
,
SEEK_SET
);
put_ebml_size
(
pb
,
pos
-
start
,
7
);
put_ebml_size
(
pb
,
pos
-
start
,
8
);
url_fseek
(
pb
,
pos
,
SEEK_SET
);
url_fseek
(
pb
,
pos
,
SEEK_SET
);
}
}
...
...
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