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
cd2ffb67
Commit
cd2ffb67
authored
Mar 20, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xa: fix timestamp calculation
The packet duration is always 28 samples.
parent
1d10afd5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
34 deletions
+32
-34
xa.c
libavformat/xa.c
+2
-4
maxis-xa
tests/ref/fate/maxis-xa
+30
-30
No files found.
libavformat/xa.c
View file @
cd2ffb67
...
...
@@ -38,7 +38,6 @@
typedef
struct
MaxisXADemuxContext
{
uint32_t
out_size
;
uint32_t
sent_bytes
;
uint32_t
audio_frame_counter
;
}
MaxisXADemuxContext
;
static
int
xa_probe
(
AVProbeData
*
p
)
...
...
@@ -87,6 +86,7 @@ static int xa_read_header(AVFormatContext *s)
st
->
codec
->
bits_per_coded_sample
=
avio_rl16
(
pb
);
avpriv_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
st
->
start_time
=
0
;
return
0
;
}
...
...
@@ -111,9 +111,7 @@ static int xa_read_packet(AVFormatContext *s,
pkt
->
stream_index
=
st
->
index
;
xa
->
sent_bytes
+=
packet_size
;
pkt
->
pts
=
xa
->
audio_frame_counter
;
/* 14 bytes Samples per channel with 2 samples per byte */
xa
->
audio_frame_counter
+=
28
*
st
->
codec
->
channels
;
pkt
->
duration
=
28
;
return
ret
;
}
...
...
tests/ref/fate/maxis-xa
View file @
cd2ffb67
#tb 0: 1/22050
0, 0, 0,
0
, 30, 0x51750711
0,
56, 56, 0
, 30, 0x9ca20c2a
0,
112, 112, 0
, 30, 0x7551081f
0,
168, 168, 0
, 30, 0x09540063
0,
224, 224, 0
, 30, 0x02c40018
0,
280, 280, 0
, 30, 0x0f6c0117
0,
336, 336, 0
, 30, 0x2aab0315
0,
392, 392, 0
, 30, 0x0e6d0117
0,
448, 448, 0
, 30, 0x04770036
0,
504, 504, 0
, 30, 0x939c090f
0,
560, 560, 0
, 30, 0xde511116
0,
616, 616, 0
, 30, 0x2f0f13f5
0,
672, 672, 0
, 30, 0x65bb0630
0,
728, 728, 0
, 30, 0x1f7a0333
0,
784, 784, 0
, 30, 0xa3d71008
0,
840, 840, 0
, 30, 0x69120801
0,
896, 896, 0
, 30, 0x1e7b0207
0,
952, 952, 0
, 30, 0x02c40018
0,
1008, 1008, 0
, 30, 0x0d050126
0,
1064, 1064, 0
, 30, 0x41c10333
0,
1120, 1120, 0
, 30, 0x16a10207
0,
1176, 1176, 0
, 30, 0x0f210207
0,
1232, 1232, 0
, 30, 0x4e4b073e
0,
1288, 1288, 0
, 30, 0xa6f20d1a
0,
1344, 1344, 0
, 30, 0xe1e40ff9
0,
1400, 1400, 0
, 30, 0x868b090f
0,
1456, 1456, 0
, 30, 0x8c85091e
0,
1512, 1512, 0
, 30, 0x5a21094b
0,
1568, 1568, 0
, 30, 0x993c0900
0,
1624, 1624, 0
, 30, 0x5b6b04e6
0, 0, 0,
28
, 30, 0x51750711
0,
28, 28, 28
, 30, 0x9ca20c2a
0,
56, 56, 28
, 30, 0x7551081f
0,
84, 84, 28
, 30, 0x09540063
0,
112, 112, 28
, 30, 0x02c40018
0,
140, 140, 28
, 30, 0x0f6c0117
0,
168, 168, 28
, 30, 0x2aab0315
0,
196, 196, 28
, 30, 0x0e6d0117
0,
224, 224, 28
, 30, 0x04770036
0,
252, 252, 28
, 30, 0x939c090f
0,
280, 280, 28
, 30, 0xde511116
0,
308, 308, 28
, 30, 0x2f0f13f5
0,
336, 336, 28
, 30, 0x65bb0630
0,
364, 364, 28
, 30, 0x1f7a0333
0,
392, 392, 28
, 30, 0xa3d71008
0,
420, 420, 28
, 30, 0x69120801
0,
448, 448, 28
, 30, 0x1e7b0207
0,
476, 476, 28
, 30, 0x02c40018
0,
504, 504, 28
, 30, 0x0d050126
0,
532, 532, 28
, 30, 0x41c10333
0,
560, 560, 28
, 30, 0x16a10207
0,
588, 588, 28
, 30, 0x0f210207
0,
616, 616, 28
, 30, 0x4e4b073e
0,
644, 644, 28
, 30, 0xa6f20d1a
0,
672, 672, 28
, 30, 0xe1e40ff9
0,
700, 700, 28
, 30, 0x868b090f
0,
728, 728, 28
, 30, 0x8c85091e
0,
756, 756, 28
, 30, 0x5a21094b
0,
784, 784, 28
, 30, 0x993c0900
0,
812, 812, 28
, 30, 0x5b6b04e6
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