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
15957b19
Commit
15957b19
authored
Mar 01, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partial rewrite stream probe code.
Fix issue2312. Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6e77feb2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
utils.c
libavformat/utils.c
+14
-11
No files found.
libavformat/utils.c
View file @
15957b19
...
...
@@ -689,11 +689,7 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt)
if
(
pktl
)
{
*
pkt
=
pktl
->
pkt
;
if
(
s
->
streams
[
pkt
->
stream_index
]
->
codec
->
codec_id
!=
CODEC_ID_PROBE
||
!
s
->
streams
[
pkt
->
stream_index
]
->
probe_packets
||
s
->
raw_packet_buffer_remaining_size
<
pkt
->
size
){
AVProbeData
*
pd
=
&
s
->
streams
[
pkt
->
stream_index
]
->
probe_data
;
av_freep
(
&
pd
->
buf
);
pd
->
buf_size
=
0
;
!
s
->
streams
[
pkt
->
stream_index
]
->
probe_packets
){
s
->
raw_packet_buffer
=
pktl
->
next
;
s
->
raw_packet_buffer_remaining_size
+=
pkt
->
size
;
av_free
(
pktl
);
...
...
@@ -731,9 +727,10 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt)
add_to_pktbuf
(
&
s
->
raw_packet_buffer
,
pkt
,
&
s
->
raw_packet_buffer_end
);
s
->
raw_packet_buffer_remaining_size
-=
pkt
->
size
;
if
(
st
->
codec
->
codec_id
==
CODEC_ID_PROBE
){
if
(
st
->
codec
->
codec_id
==
CODEC_ID_PROBE
&&
st
->
probe_packets
){
AVProbeData
*
pd
=
&
st
->
probe_data
;
av_log
(
s
,
AV_LOG_DEBUG
,
"probing stream %d
\n
"
,
st
->
index
);
int
end
;
av_log
(
s
,
AV_LOG_DEBUG
,
"probing stream %d pp:%d
\n
"
,
st
->
index
,
st
->
probe_packets
);
--
st
->
probe_packets
;
pd
->
buf
=
av_realloc
(
pd
->
buf
,
pd
->
buf_size
+
pkt
->
size
+
AVPROBE_PADDING_SIZE
);
...
...
@@ -741,13 +738,19 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt)
pd
->
buf_size
+=
pkt
->
size
;
memset
(
pd
->
buf
+
pd
->
buf_size
,
0
,
AVPROBE_PADDING_SIZE
);
if
(
av_log2
(
pd
->
buf_size
)
!=
av_log2
(
pd
->
buf_size
-
pkt
->
size
)){
//FIXME we dont reduce score to 0 for the case of running out of buffer space in bytes
set_codec_from_probe_data
(
s
,
st
,
pd
,
st
->
probe_packets
>
0
?
AVPROBE_SCORE_MAX
/
4
:
0
);
if
(
st
->
codec
->
codec_id
!=
CODEC_ID_PROBE
){
end
=
s
->
raw_packet_buffer_remaining_size
<=
0
||
st
->
probe_packets
<=
0
;
if
(
end
||
av_log2
(
pd
->
buf_size
)
!=
av_log2
(
pd
->
buf_size
-
pkt
->
size
)){
set_codec_from_probe_data
(
s
,
st
,
pd
,
end
?
0
:
AVPROBE_SCORE_MAX
/
4
);
if
(
st
->
codec
->
codec_id
!=
CODEC_ID_PROBE
||
end
){
pd
->
buf_size
=
0
;
av_freep
(
&
pd
->
buf
);
st
->
probe_packets
=
0
;
if
(
st
->
codec
->
codec_id
!=
CODEC_ID_PROBE
){
av_log
(
s
,
AV_LOG_DEBUG
,
"probed stream %d
\n
"
,
st
->
index
);
}
else
av_log
(
s
,
AV_LOG_WARNING
,
"probed stream %d failed
\n
"
,
st
->
index
);
}
}
}
...
...
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