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
097653ba
Commit
097653ba
authored
Feb 14, 2023
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/cdg: add probe
parent
eabc304d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
cdg.c
libavformat/cdg.c
+17
-0
No files found.
libavformat/cdg.c
View file @
097653ba
...
...
@@ -26,6 +26,22 @@
#define CDG_COMMAND 0x09
#define CDG_MASK 0x3F
static
int
read_probe
(
const
AVProbeData
*
p
)
{
const
int
cnt
=
p
->
buf_size
/
CDG_PACKET_SIZE
;
int
score
=
0
;
for
(
int
i
=
0
;
i
<
cnt
;
i
++
)
{
const
int
x
=
p
->
buf
[
i
*
CDG_PACKET_SIZE
]
&
CDG_MASK
;
score
+=
x
==
CDG_COMMAND
;
if
(
x
!=
CDG_COMMAND
&&
x
!=
0
)
return
0
;
}
return
FFMIN
(
score
,
AVPROBE_SCORE_MAX
);
}
static
int
read_header
(
AVFormatContext
*
s
)
{
AVStream
*
vst
;
...
...
@@ -70,6 +86,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
const
AVInputFormat
ff_cdg_demuxer
=
{
.
name
=
"cdg"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"CD Graphics"
),
.
read_probe
=
read_probe
,
.
read_header
=
read_header
,
.
read_packet
=
read_packet
,
.
flags
=
AVFMT_GENERIC_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