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
cf4d050b
Commit
cf4d050b
authored
Apr 03, 2016
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/wavdec: Remove direct s->pb->buffer access
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
fcbdc44f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
wavdec.c
libavformat/wavdec.c
+24
-2
No files found.
libavformat/wavdec.c
View file @
cf4d050b
...
@@ -64,12 +64,34 @@ static void set_spdif(AVFormatContext *s, WAVDemuxContext *wav)
...
@@ -64,12 +64,34 @@ static void set_spdif(AVFormatContext *s, WAVDemuxContext *wav)
{
{
if
(
CONFIG_SPDIF_DEMUXER
&&
s
->
streams
[
0
]
->
codec
->
codec_tag
==
1
)
{
if
(
CONFIG_SPDIF_DEMUXER
&&
s
->
streams
[
0
]
->
codec
->
codec_tag
==
1
)
{
enum
AVCodecID
codec
;
enum
AVCodecID
codec
;
int
ret
=
ff_spdif_probe
(
s
->
pb
->
buffer
,
s
->
pb
->
buf_end
-
s
->
pb
->
buffer
,
uint8_t
*
buf
=
NULL
;
&
codec
);
int
ret
=
ffio_ensure_seekback
(
s
->
pb
,
sizeof
(
buf
));
int
len
=
1
<<
16
;
int64_t
pos
=
avio_tell
(
s
->
pb
);
if
(
ret
<
0
)
goto
end
;
buf
=
av_malloc
(
len
);
if
(
!
buf
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
}
len
=
ret
=
avio_read
(
s
->
pb
,
buf
,
len
);
if
(
ret
<
0
)
goto
end
;
ret
=
ff_spdif_probe
(
buf
,
len
,
&
codec
);
if
(
ret
>
AVPROBE_SCORE_EXTENSION
)
{
if
(
ret
>
AVPROBE_SCORE_EXTENSION
)
{
s
->
streams
[
0
]
->
codec
->
codec_id
=
codec
;
s
->
streams
[
0
]
->
codec
->
codec_id
=
codec
;
wav
->
spdif
=
1
;
wav
->
spdif
=
1
;
}
}
end:
avio_seek
(
s
->
pb
,
pos
,
SEEK_SET
);
if
(
ret
<
0
)
av_log
(
s
,
AV_LOG_WARNING
,
"Cannot check for SPDIF
\n
"
);
av_free
(
buf
);
}
}
}
}
...
...
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