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
d8b5abfa
Commit
d8b5abfa
authored
Oct 01, 2004
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify put_padding_packet()
Originally committed as revision 3549 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
c40a3a42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
24 deletions
+9
-24
mpeg.c
libavformat/mpeg.c
+9
-24
No files found.
libavformat/mpeg.c
View file @
d8b5abfa
...
...
@@ -55,7 +55,7 @@ typedef struct {
computed (VBR case) */
int64_t
last_scr
;
/* current system clock */
double
vcd_padding_bitrate
;
double
vcd_padding_bitrate
;
//FIXME floats
int64_t
vcd_padding_bytes_written
;
}
MpegMuxContext
;
...
...
@@ -530,33 +530,18 @@ static int get_packet_payload_size(AVFormatContext *ctx, int stream_index,
}
/* Write an MPEG padding packet header. */
static
int
put_padding_header
(
AVFormatContext
*
ctx
,
uint8_t
*
buf
,
int
full_padding_size
)
static
void
put_padding_packet
(
AVFormatContext
*
ctx
,
ByteIOContext
*
pb
,
int
packet_bytes
)
{
MpegMuxContext
*
s
=
ctx
->
priv_data
;
int
size
=
full_padding_size
-
6
;
/* subtract header length */
buf
[
0
]
=
(
uint8_t
)(
PADDING_STREAM
>>
24
);
buf
[
1
]
=
(
uint8_t
)(
PADDING_STREAM
>>
16
);
buf
[
2
]
=
(
uint8_t
)(
PADDING_STREAM
>>
8
);
buf
[
3
]
=
(
uint8_t
)(
PADDING_STREAM
);
buf
[
4
]
=
(
uint8_t
)(
size
>>
8
);
buf
[
5
]
=
(
uint8_t
)(
size
&
0xff
);
int
i
;
put_be32
(
pb
,
PADDING_STREAM
);
put_be16
(
pb
,
packet_bytes
-
6
);
if
(
!
s
->
is_mpeg2
)
{
buf
[
6
]
=
0x0f
;
return
7
;
put_byte
(
pb
,
0x0f
)
;
packet_bytes
-=
7
;
}
else
return
6
;
}
static
void
put_padding_packet
(
AVFormatContext
*
ctx
,
ByteIOContext
*
pb
,
int
packet_bytes
)
{
uint8_t
buffer
[
7
];
int
size
,
i
;
size
=
put_padding_header
(
ctx
,
buffer
,
packet_bytes
);
put_buffer
(
pb
,
buffer
,
size
);
packet_bytes
-=
size
;
packet_bytes
-=
6
;
for
(
i
=
0
;
i
<
packet_bytes
;
i
++
)
put_byte
(
pb
,
0xff
);
...
...
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