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
5bafe0ce
Commit
5bafe0ce
authored
Jun 07, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tta: replace datalen with nb_samples
This is less confusing. Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
dc5c029f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
tta.c
libavformat/tta.c
+7
-7
No files found.
libavformat/tta.c
View file @
5bafe0ce
...
...
@@ -57,7 +57,7 @@ static int tta_read_header(AVFormatContext *s)
AVStream
*
st
;
int
i
,
channels
,
bps
,
samplerate
;
uint64_t
framepos
,
start_offset
;
uint32_t
datalen
,
crc
;
uint32_t
nb_samples
,
crc
;
if
(
s
->
pb
->
seekable
)
{
ff_ape_parse_tag
(
s
);
...
...
@@ -80,9 +80,9 @@ static int tta_read_header(AVFormatContext *s)
return
AVERROR_INVALIDDATA
;
}
datalen
=
avio_rl32
(
s
->
pb
);
if
(
!
datalen
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"invalid
datalen
\n
"
);
nb_samples
=
avio_rl32
(
s
->
pb
);
if
(
!
nb_samples
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"invalid
number of samples
\n
"
);
return
AVERROR_INVALIDDATA
;
}
...
...
@@ -93,10 +93,10 @@ static int tta_read_header(AVFormatContext *s)
}
c
->
frame_size
=
samplerate
*
256
/
245
;
c
->
last_frame_size
=
datalen
%
c
->
frame_size
;
c
->
last_frame_size
=
nb_samples
%
c
->
frame_size
;
if
(
!
c
->
last_frame_size
)
c
->
last_frame_size
=
c
->
frame_size
;
c
->
totalframes
=
datalen
/
c
->
frame_size
+
(
c
->
last_frame_size
<
c
->
frame_size
);
c
->
totalframes
=
nb_samples
/
c
->
frame_size
+
(
c
->
last_frame_size
<
c
->
frame_size
);
c
->
currentframe
=
0
;
if
(
c
->
totalframes
>=
UINT_MAX
/
sizeof
(
uint32_t
)
||
c
->
totalframes
<=
0
){
...
...
@@ -110,7 +110,7 @@ static int tta_read_header(AVFormatContext *s)
avpriv_set_pts_info
(
st
,
64
,
1
,
samplerate
);
st
->
start_time
=
0
;
st
->
duration
=
datalen
;
st
->
duration
=
nb_samples
;
framepos
=
avio_tell
(
s
->
pb
)
+
4
*
c
->
totalframes
+
4
;
...
...
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