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
5aff31b1
Commit
5aff31b1
authored
Apr 25, 2011
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vorbisdec: allow selecting float output at runtime.
parent
26d5a4b6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
vorbisdec.c
libavcodec/vorbisdec.c
+12
-15
No files found.
libavcodec/vorbisdec.c
View file @
5aff31b1
...
@@ -1007,12 +1007,9 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext)
...
@@ -1007,12 +1007,9 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext)
avccontext
->
channels
=
vc
->
audio_channels
;
avccontext
->
channels
=
vc
->
audio_channels
;
avccontext
->
sample_rate
=
vc
->
audio_samplerate
;
avccontext
->
sample_rate
=
vc
->
audio_samplerate
;
avccontext
->
frame_size
=
FFMIN
(
vc
->
blocksize
[
0
],
vc
->
blocksize
[
1
])
>>
2
;
avccontext
->
frame_size
=
FFMIN
(
vc
->
blocksize
[
0
],
vc
->
blocksize
[
1
])
>>
2
;
/* ffdshow custom code */
avccontext
->
sample_fmt
=
#if CONFIG_AUDIO_FLOAT
avccontext
->
request_sample_fmt
==
AV_SAMPLE_FMT_FLT
?
avccontext
->
sample_fmt
=
AV_SAMPLE_FMT_FLT
;
AV_SAMPLE_FMT_FLT
:
AV_SAMPLE_FMT_S16
;
#else
avccontext
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
#endif
return
0
;
return
0
;
}
}
...
@@ -1640,15 +1637,15 @@ static int vorbis_decode_frame(AVCodecContext *avccontext,
...
@@ -1640,15 +1637,15 @@ static int vorbis_decode_frame(AVCodecContext *avccontext,
len
*
ff_vorbis_channel_layout_offsets
[
vc
->
audio_channels
-
1
][
i
];
len
*
ff_vorbis_channel_layout_offsets
[
vc
->
audio_channels
-
1
][
i
];
}
}
/* ffdshow custom code */
*
data_size
=
len
*
vc
->
audio_channels
;
#if CONFIG_AUDIO_FLOAT
if
(
avccontext
->
sample_fmt
==
AV_SAMPLE_FMT_FLT
)
{
float_interleave
(
data
,
channel_ptrs
,
len
,
vc
->
audio_channels
);
float_interleave
(
data
,
channel_ptrs
,
len
,
vc
->
audio_channels
);
*
data_size
=
len
*
sizeof
(
float
)
*
vc
->
audio_channels
;
*
data_size
*=
sizeof
(
float
)
;
#else
}
else
{
vc
->
fmt_conv
.
float_to_int16_interleave
(
data
,
channel_ptrs
,
len
,
vc
->
fmt_conv
.
float_to_int16_interleave
(
data
,
channel_ptrs
,
len
,
vc
->
audio_channels
);
vc
->
audio_channels
);
*
data_size
=
len
*
2
*
vc
->
audio_channels
;
*
data_size
*=
2
;
#endif
}
return
buf_size
;
return
buf_size
;
}
}
...
...
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