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
39d98346
Commit
39d98346
authored
May 25, 2011
by
Reuben Thomas
Committed by
Carl Eugen Hoyos
May 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add reading of disc number to mov.c
parent
a3da1773
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
mov.c
libavformat/mov.c
+8
-6
No files found.
libavformat/mov.c
View file @
39d98346
...
@@ -79,15 +79,15 @@ typedef struct MOVParseTableEntry {
...
@@ -79,15 +79,15 @@ typedef struct MOVParseTableEntry {
static
const
MOVParseTableEntry
mov_default_parse_table
[];
static
const
MOVParseTableEntry
mov_default_parse_table
[];
static
int
mov_metadata_tr
kn
(
MOVContext
*
c
,
AVIOContext
*
pb
,
unsigned
len
)
static
int
mov_metadata_tr
ack_or_disc_number
(
MOVContext
*
c
,
AVIOContext
*
pb
,
unsigned
len
,
const
char
*
type
)
{
{
char
buf
[
16
];
char
buf
[
16
];
avio_rb16
(
pb
);
// unknown
avio_rb16
(
pb
);
// unknown
snprintf
(
buf
,
sizeof
(
buf
),
"%d"
,
avio_rb16
(
pb
));
snprintf
(
buf
,
sizeof
(
buf
),
"%d"
,
avio_rb16
(
pb
));
av_metadata_set2
(
&
c
->
fc
->
metadata
,
"track"
,
buf
,
0
);
av_metadata_set2
(
&
c
->
fc
->
metadata
,
type
,
buf
,
0
);
avio_rb16
(
pb
);
// total tracks
avio_rb16
(
pb
);
// total tracks
/discs
return
0
;
return
0
;
}
}
...
@@ -138,7 +138,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
...
@@ -138,7 +138,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
const
char
*
key
=
NULL
;
const
char
*
key
=
NULL
;
uint16_t
str_size
,
langcode
=
0
;
uint16_t
str_size
,
langcode
=
0
;
uint32_t
data_type
=
0
;
uint32_t
data_type
=
0
;
int
(
*
parse
)(
MOVContext
*
,
AVIOContext
*
,
unsigned
)
=
NULL
;
int
(
*
parse
)(
MOVContext
*
,
AVIOContext
*
,
unsigned
,
const
char
*
)
=
NULL
;
switch
(
atom
.
type
)
{
switch
(
atom
.
type
)
{
case
MKTAG
(
0xa9
,
'n'
,
'a'
,
'm'
):
key
=
"title"
;
break
;
case
MKTAG
(
0xa9
,
'n'
,
'a'
,
'm'
):
key
=
"title"
;
break
;
...
@@ -164,7 +164,9 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
...
@@ -164,7 +164,9 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
case
MKTAG
(
't'
,
'v'
,
'e'
,
'n'
):
key
=
"episode_id"
;
break
;
case
MKTAG
(
't'
,
'v'
,
'e'
,
'n'
):
key
=
"episode_id"
;
break
;
case
MKTAG
(
't'
,
'v'
,
'n'
,
'n'
):
key
=
"network"
;
break
;
case
MKTAG
(
't'
,
'v'
,
'n'
,
'n'
):
key
=
"network"
;
break
;
case
MKTAG
(
't'
,
'r'
,
'k'
,
'n'
):
key
=
"track"
;
case
MKTAG
(
't'
,
'r'
,
'k'
,
'n'
):
key
=
"track"
;
parse
=
mov_metadata_trkn
;
break
;
parse
=
mov_metadata_track_or_disc_number
;
break
;
case
MKTAG
(
'd'
,
'i'
,
's'
,
'k'
):
key
=
"disc"
;
parse
=
mov_metadata_track_or_disc_number
;
break
;
}
}
if
(
c
->
itunes_metadata
&&
atom
.
size
>
8
)
{
if
(
c
->
itunes_metadata
&&
atom
.
size
>
8
)
{
...
@@ -199,7 +201,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
...
@@ -199,7 +201,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
str_size
=
FFMIN3
(
sizeof
(
str
)
-
1
,
str_size
,
atom
.
size
);
str_size
=
FFMIN3
(
sizeof
(
str
)
-
1
,
str_size
,
atom
.
size
);
if
(
parse
)
if
(
parse
)
parse
(
c
,
pb
,
str_size
);
parse
(
c
,
pb
,
str_size
,
key
);
else
{
else
{
if
(
data_type
==
3
||
(
data_type
==
0
&&
langcode
<
0x800
))
{
// MAC Encoded
if
(
data_type
==
3
||
(
data_type
==
0
&&
langcode
<
0x800
))
{
// MAC Encoded
mov_read_mac_string
(
c
,
pb
,
str_size
,
str
,
sizeof
(
str
));
mov_read_mac_string
(
c
,
pb
,
str_size
,
str
,
sizeof
(
str
));
...
...
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