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
a98cadef
Commit
a98cadef
authored
Jul 26, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc/examples/muxing: Move samples_count to OutputStream
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
8b1d54ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
muxing.c
doc/examples/muxing.c
+3
-4
No files found.
doc/examples/muxing.c
View file @
a98cadef
...
...
@@ -55,6 +55,7 @@ typedef struct OutputStream {
/* pts of the next frame that will be generated */
int64_t
next_pts
;
int
samples_count
;
AVFrame
*
frame
;
AVFrame
*
tmp_frame
;
...
...
@@ -177,8 +178,6 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
/**************************************************************/
/* audio output */
int
samples_count
;
static
void
open_audio
(
AVFormatContext
*
oc
,
AVCodec
*
codec
,
OutputStream
*
ost
,
AVDictionary
*
opt_arg
)
{
AVCodecContext
*
c
;
...
...
@@ -332,8 +331,8 @@ static int write_audio_frame(AVFormatContext *oc, OutputStream *ost)
dst_nb_samples
=
frame
->
nb_samples
;
}
frame
->
pts
=
av_rescale_q
(
samples_count
,
(
AVRational
){
1
,
c
->
sample_rate
},
c
->
time_base
);
samples_count
+=
dst_nb_samples
;
frame
->
pts
=
av_rescale_q
(
ost
->
samples_count
,
(
AVRational
){
1
,
c
->
sample_rate
},
c
->
time_base
);
ost
->
samples_count
+=
dst_nb_samples
;
}
ret
=
avcodec_encode_audio2
(
c
,
&
pkt
,
frame
,
&
got_packet
);
...
...
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