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
d62e979b
Commit
d62e979b
authored
Dec 12, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_sofalizer: display some info when loading sofa file
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
0a19538b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
8 deletions
+41
-8
af_sofalizer.c
libavfilter/af_sofalizer.c
+41
-8
No files found.
libavfilter/af_sofalizer.c
View file @
d62e979b
...
...
@@ -108,7 +108,7 @@ static int load_sofa(AVFilterContext *ctx, char *filename, int *samplingrate)
char
*
sofa_conventions
;
char
dim_name
[
NC_MAX_NAME
];
/* names of netCDF dimensions */
size_t
*
dim_length
;
/* lengths of netCDF dimensions */
char
*
psz_conventions
;
char
*
text
;
unsigned
int
sample_rate
;
int
data_delay_dim_id
[
2
];
int
samplingrate_id
;
...
...
@@ -170,21 +170,54 @@ static int load_sofa(AVFilterContext *ctx, char *filename, int *samplingrate)
}
/* check whether file is SOFA file */
psz_conventions
=
av_malloc
(
att_len
+
1
);
if
(
!
psz_conventions
)
{
text
=
av_malloc
(
att_len
+
1
);
if
(
!
text
)
{
nc_close
(
ncid
);
return
AVERROR
(
ENOMEM
);
}
nc_get_att_text
(
ncid
,
NC_GLOBAL
,
"Conventions"
,
psz_conventions
);
*
(
psz_conventions
+
att_len
)
=
0
;
if
(
strncmp
(
"SOFA"
,
psz_conventions
,
4
))
{
nc_get_att_text
(
ncid
,
NC_GLOBAL
,
"Conventions"
,
text
);
*
(
text
+
att_len
)
=
0
;
if
(
strncmp
(
"SOFA"
,
text
,
4
))
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Not a SOFA file!
\n
"
);
av_freep
(
&
psz_conventions
);
av_freep
(
&
text
);
nc_close
(
ncid
);
return
AVERROR
(
EINVAL
);
}
av_freep
(
&
psz_conventions
);
av_freep
(
&
text
);
status
=
nc_inq_attlen
(
ncid
,
NC_GLOBAL
,
"License"
,
&
att_len
);
if
(
status
==
NC_NOERR
)
{
text
=
av_malloc
(
att_len
+
1
);
if
(
text
)
{
nc_get_att_text
(
ncid
,
NC_GLOBAL
,
"License"
,
text
);
*
(
text
+
att_len
)
=
0
;
av_log
(
ctx
,
AV_LOG_INFO
,
"SOFA file License: %s
\n
"
,
text
);
av_freep
(
&
text
);
}
}
status
=
nc_inq_attlen
(
ncid
,
NC_GLOBAL
,
"SourceDescription"
,
&
att_len
);
if
(
status
==
NC_NOERR
)
{
text
=
av_malloc
(
att_len
+
1
);
if
(
text
)
{
nc_get_att_text
(
ncid
,
NC_GLOBAL
,
"SourceDescription"
,
text
);
*
(
text
+
att_len
)
=
0
;
av_log
(
ctx
,
AV_LOG_INFO
,
"SOFA file SourceDescription: %s
\n
"
,
text
);
av_freep
(
&
text
);
}
}
status
=
nc_inq_attlen
(
ncid
,
NC_GLOBAL
,
"Comment"
,
&
att_len
);
if
(
status
==
NC_NOERR
)
{
text
=
av_malloc
(
att_len
+
1
);
if
(
text
)
{
nc_get_att_text
(
ncid
,
NC_GLOBAL
,
"Comment"
,
text
);
*
(
text
+
att_len
)
=
0
;
av_log
(
ctx
,
AV_LOG_INFO
,
"SOFA file Comment: %s
\n
"
,
text
);
av_freep
(
&
text
);
}
}
status
=
nc_inq_attlen
(
ncid
,
NC_GLOBAL
,
"SOFAConventions"
,
&
att_len
);
if
(
status
!=
NC_NOERR
)
{
...
...
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