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
be14a370
Commit
be14a370
authored
Jan 24, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aud: fix time stamp calculation for ADPCM IMA WS
also allows for removing some unused context fields
parent
10fef6bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
westwood_aud.c
libavformat/westwood_aud.c
+1
-9
No files found.
libavformat/westwood_aud.c
View file @
be14a370
...
@@ -42,10 +42,7 @@
...
@@ -42,10 +42,7 @@
#define AUD_CHUNK_SIGNATURE 0x0000DEAF
#define AUD_CHUNK_SIGNATURE 0x0000DEAF
typedef
struct
WsAudDemuxContext
{
typedef
struct
WsAudDemuxContext
{
int
audio_channels
;
int
audio_samplerate
;
int
audio_stream_index
;
int
audio_stream_index
;
int64_t
audio_frame_counter
;
}
WsAudDemuxContext
;
}
WsAudDemuxContext
;
static
int
wsaud_probe
(
AVProbeData
*
p
)
static
int
wsaud_probe
(
AVProbeData
*
p
)
...
@@ -131,10 +128,7 @@ static int wsaud_read_header(AVFormatContext *s,
...
@@ -131,10 +128,7 @@ static int wsaud_read_header(AVFormatContext *s,
st
->
codec
->
channels
=
channels
;
st
->
codec
->
channels
=
channels
;
st
->
codec
->
sample_rate
=
sample_rate
;
st
->
codec
->
sample_rate
=
sample_rate
;
wsaud
->
audio_channels
=
channels
;
wsaud
->
audio_samplerate
=
sample_rate
;
wsaud
->
audio_stream_index
=
st
->
index
;
wsaud
->
audio_stream_index
=
st
->
index
;
wsaud
->
audio_frame_counter
=
0
;
return
0
;
return
0
;
}
}
...
@@ -177,11 +171,9 @@ static int wsaud_read_packet(AVFormatContext *s,
...
@@ -177,11 +171,9 @@ static int wsaud_read_packet(AVFormatContext *s,
ret
=
av_get_packet
(
pb
,
pkt
,
chunk_size
);
ret
=
av_get_packet
(
pb
,
pkt
,
chunk_size
);
if
(
ret
!=
chunk_size
)
if
(
ret
!=
chunk_size
)
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
pkt
->
pts
=
wsaud
->
audio_frame_counter
;
pkt
->
pts
/=
wsaud
->
audio_samplerate
;
/* 2 samples/byte, 1 or 2 samples per frame depending on stereo */
/* 2 samples/byte, 1 or 2 samples per frame depending on stereo */
wsaud
->
audio_frame_counter
+=
(
chunk_size
*
2
)
/
wsaud
->
audio_
channels
;
pkt
->
duration
=
(
chunk_size
*
2
)
/
st
->
codec
->
channels
;
}
}
pkt
->
stream_index
=
st
->
index
;
pkt
->
stream_index
=
st
->
index
;
...
...
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