Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
521cca13
Commit
521cca13
authored
Jan 29, 2020
by
Anton Khirnov
Committed by
James Almer
Mar 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
argo: convert to new channel layout API
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
057f237c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
13 deletions
+10
-13
argo_asf.c
libavformat/argo_asf.c
+8
-10
argo_cvg.c
libavformat/argo_cvg.c
+2
-3
No files found.
libavformat/argo_asf.c
View file @
521cca13
...
...
@@ -96,11 +96,9 @@ int ff_argo_asf_fill_stream(AVFormatContext *s, AVStream *st, const ArgoASFFileH
st
->
codecpar
->
format
=
AV_SAMPLE_FMT_S16P
;
if
(
ckhdr
->
flags
&
ASF_CF_STEREO
)
{
st
->
codecpar
->
channel_layout
=
AV_CH_LAYOUT_STEREO
;
st
->
codecpar
->
channels
=
2
;
st
->
codecpar
->
ch_layout
=
(
AVChannelLayout
)
AV_CHANNEL_LAYOUT_STEREO
;
}
else
{
st
->
codecpar
->
channel_layout
=
AV_CH_LAYOUT_MONO
;
st
->
codecpar
->
channels
=
1
;
st
->
codecpar
->
ch_layout
=
(
AVChannelLayout
)
AV_CHANNEL_LAYOUT_MONO
;
}
/* v1.1 files (FX Fighter) are all marked as 44100, but are actually 22050. */
...
...
@@ -121,11 +119,11 @@ int ff_argo_asf_fill_stream(AVFormatContext *s, AVStream *st, const ArgoASFFileH
* (nchannel control bytes) + ((bytes_per_channel) * nchannel)
* For mono, this is 17. For stereo, this is 34.
*/
st
->
codecpar
->
block_align
=
st
->
codecpar
->
channels
+
st
->
codecpar
->
block_align
=
st
->
codecpar
->
ch
_layout
.
nb_ch
annels
+
(
ckhdr
->
num_samples
/
2
)
*
st
->
codecpar
->
channels
;
st
->
codecpar
->
ch
_layout
.
nb_ch
annels
;
st
->
codecpar
->
bit_rate
=
st
->
codecpar
->
channels
*
st
->
codecpar
->
bit_rate
=
st
->
codecpar
->
ch
_layout
.
nb_ch
annels
*
st
->
codecpar
->
sample_rate
*
st
->
codecpar
->
bits_per_coded_sample
;
...
...
@@ -305,12 +303,12 @@ static int argo_asf_write_init(AVFormatContext *s)
return
AVERROR
(
EINVAL
);
}
if
(
par
->
channels
>
2
)
{
if
(
par
->
ch
_layout
.
nb_ch
annels
>
2
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"ASF files only support up to 2 channels
\n
"
);
return
AVERROR
(
EINVAL
);
}
if
(
par
->
block_align
!=
17
*
par
->
channels
)
if
(
par
->
block_align
!=
17
*
par
->
ch
_layout
.
nb_ch
annels
)
return
AVERROR
(
EINVAL
);
if
(
par
->
sample_rate
>
UINT16_MAX
)
{
...
...
@@ -392,7 +390,7 @@ static int argo_asf_write_header(AVFormatContext *s)
chdr
.
unk2
=
~
0
;
chdr
.
flags
=
ASF_CF_BITS_PER_SAMPLE
|
ASF_CF_ALWAYS1
;
if
(
par
->
channels
==
2
)
if
(
par
->
ch
_layout
.
nb_ch
annels
==
2
)
chdr
.
flags
|=
ASF_CF_STEREO
;
argo_asf_write_file_header
(
&
fhdr
,
s
->
pb
);
...
...
libavformat/argo_cvg.c
View file @
521cca13
...
...
@@ -182,8 +182,7 @@ static int argo_cvg_read_header(AVFormatContext *s)
break
;
}
par
->
channels
=
1
;
par
->
channel_layout
=
AV_CH_LAYOUT_MONO
;
par
->
ch_layout
=
(
AVChannelLayout
)
AV_CHANNEL_LAYOUT_MONO
;
par
->
bits_per_coded_sample
=
4
;
par
->
block_align
=
ARGO_CVG_BLOCK_ALIGN
;
...
...
@@ -275,7 +274,7 @@ static int argo_cvg_write_init(AVFormatContext *s)
return
AVERROR
(
EINVAL
);
}
if
(
par
->
channels
!=
1
)
{
if
(
par
->
ch
_layout
.
nb_ch
annels
!=
1
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"CVG files only support 1 channel
\n
"
);
return
AVERROR
(
EINVAL
);
}
...
...
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