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
f7a9a996
Commit
f7a9a996
authored
Oct 30, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wavenc: fix curruption of metadata
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
2f84f138
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
wavenc.c
libavformat/wavenc.c
+5
-4
No files found.
libavformat/wavenc.c
View file @
f7a9a996
...
...
@@ -36,6 +36,7 @@
typedef
struct
WAVMuxContext
{
const
AVClass
*
class
;
int64_t
data
;
int64_t
fact_pos
;
int64_t
minpts
;
int64_t
maxpts
;
int
last_duration
;
...
...
@@ -100,7 +101,7 @@ static int wav_write_header(AVFormatContext *s)
{
WAVMuxContext
*
wav
=
s
->
priv_data
;
AVIOContext
*
pb
=
s
->
pb
;
int64_t
fmt
,
fact
;
int64_t
fmt
;
ffio_wfourcc
(
pb
,
"RIFF"
);
avio_wl32
(
pb
,
0
);
/* file length */
...
...
@@ -117,9 +118,9 @@ static int wav_write_header(AVFormatContext *s)
if
(
s
->
streams
[
0
]
->
codec
->
codec_tag
!=
0x01
/* hence for all other than PCM */
&&
s
->
pb
->
seekable
)
{
fact
=
ff_start_tag
(
pb
,
"fact"
);
wav
->
fact_pos
=
ff_start_tag
(
pb
,
"fact"
);
avio_wl32
(
pb
,
0
);
ff_end_tag
(
pb
,
fact
);
ff_end_tag
(
pb
,
wav
->
fact_pos
);
}
if
(
wav
->
write_bext
)
...
...
@@ -179,7 +180,7 @@ static int wav_write_trailer(AVFormatContext *s)
number_of_samples
=
av_rescale
(
wav
->
maxpts
-
wav
->
minpts
+
wav
->
last_duration
,
s
->
streams
[
0
]
->
codec
->
sample_rate
*
(
int64_t
)
s
->
streams
[
0
]
->
time_base
.
num
,
s
->
streams
[
0
]
->
time_base
.
den
);
avio_seek
(
pb
,
wav
->
data
-
12
,
SEEK_SET
);
avio_seek
(
pb
,
wav
->
fact_pos
,
SEEK_SET
);
avio_wl32
(
pb
,
number_of_samples
);
avio_seek
(
pb
,
file_size
,
SEEK_SET
);
avio_flush
(
pb
);
...
...
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