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
fd5583bc
Commit
fd5583bc
authored
Jan 31, 2009
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new ff_interleave_add_packet
Originally committed as revision 16885 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
ccf0071d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
23 deletions
+14
-23
oggenc.c
libavformat/oggenc.c
+14
-23
No files found.
libavformat/oggenc.c
View file @
fd5583bc
...
@@ -202,36 +202,27 @@ static int ogg_write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -202,36 +202,27 @@ static int ogg_write_packet(AVFormatContext *s, AVPacket *pkt)
return
0
;
return
0
;
}
}
static
int
ogg_compare_granule
(
AVFormatContext
*
s
,
AVPacket
*
next
,
AVPacket
*
pkt
)
{
AVStream
*
st2
=
s
->
streams
[
next
->
stream_index
];
AVStream
*
st
=
s
->
streams
[
pkt
->
stream_index
];
int64_t
next_granule
=
av_rescale_q
(
next
->
pts
+
next
->
duration
,
st2
->
time_base
,
AV_TIME_BASE_Q
);
int64_t
cur_granule
=
av_rescale_q
(
pkt
->
pts
+
pkt
->
duration
,
st
->
time_base
,
AV_TIME_BASE_Q
);
return
next_granule
>
cur_granule
;
}
int
ogg_interleave_per_granule
(
AVFormatContext
*
s
,
AVPacket
*
out
,
AVPacket
*
pkt
,
int
flush
)
int
ogg_interleave_per_granule
(
AVFormatContext
*
s
,
AVPacket
*
out
,
AVPacket
*
pkt
,
int
flush
)
{
{
AVPacketList
*
pktl
,
**
next_point
,
*
this_pktl
;
AVPacketList
*
pktl
;
int
stream_count
=
0
;
int
stream_count
=
0
;
int
streams
[
MAX_STREAMS
]
=
{
0
};
int
streams
[
MAX_STREAMS
]
=
{
0
};
int
interleaved
=
0
;
int
interleaved
=
0
;
if
(
pkt
)
{
if
(
pkt
)
{
AVStream
*
st
=
s
->
streams
[
pkt
->
stream_index
];
ff_interleave_add_packet
(
s
,
pkt
,
ogg_compare_granule
);
this_pktl
=
av_mallocz
(
sizeof
(
AVPacketList
));
this_pktl
->
pkt
=
*
pkt
;
if
(
pkt
->
destruct
==
av_destruct_packet
)
pkt
->
destruct
=
NULL
;
// not shared -> must keep original from being freed
else
av_dup_packet
(
&
this_pktl
->
pkt
);
// shared -> must dup
next_point
=
&
s
->
packet_buffer
;
while
(
*
next_point
)
{
AVStream
*
st2
=
s
->
streams
[(
*
next_point
)
->
pkt
.
stream_index
];
AVPacket
*
next_pkt
=
&
(
*
next_point
)
->
pkt
;
int64_t
cur_granule
,
next_granule
;
next_granule
=
av_rescale_q
(
next_pkt
->
pts
+
next_pkt
->
duration
,
st2
->
time_base
,
AV_TIME_BASE_Q
);
cur_granule
=
av_rescale_q
(
pkt
->
pts
+
pkt
->
duration
,
st
->
time_base
,
AV_TIME_BASE_Q
);
if
(
next_granule
>
cur_granule
)
break
;
next_point
=
&
(
*
next_point
)
->
next
;
}
this_pktl
->
next
=
*
next_point
;
*
next_point
=
this_pktl
;
}
}
pktl
=
s
->
packet_buffer
;
pktl
=
s
->
packet_buffer
;
...
...
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