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
d7638d8d
Commit
d7638d8d
authored
Oct 05, 2018
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flvdec: Export unknown metadata packets as opaque data
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
e7ed9d81
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
flv.h
libavformat/flv.h
+1
-0
flvdec.c
libavformat/flvdec.c
+14
-4
version.h
libavformat/version.h
+1
-1
No files found.
libavformat/flv.h
View file @
d7638d8d
...
@@ -66,6 +66,7 @@ enum {
...
@@ -66,6 +66,7 @@ enum {
FLV_STREAM_TYPE_VIDEO
,
FLV_STREAM_TYPE_VIDEO
,
FLV_STREAM_TYPE_AUDIO
,
FLV_STREAM_TYPE_AUDIO
,
FLV_STREAM_TYPE_SUBTITLE
,
FLV_STREAM_TYPE_SUBTITLE
,
FLV_STREAM_TYPE_DATA
,
FLV_STREAM_TYPE_NB
,
FLV_STREAM_TYPE_NB
,
};
};
...
...
libavformat/flvdec.c
View file @
d7638d8d
...
@@ -143,7 +143,9 @@ static AVStream *create_stream(AVFormatContext *s, int codec_type)
...
@@ -143,7 +143,9 @@ static AVStream *create_stream(AVFormatContext *s, int codec_type)
st
->
codecpar
->
codec_type
=
codec_type
;
st
->
codecpar
->
codec_type
=
codec_type
;
if
(
s
->
nb_streams
>=
3
||
(
s
->
nb_streams
==
2
if
(
s
->
nb_streams
>=
3
||
(
s
->
nb_streams
==
2
&&
s
->
streams
[
0
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
&&
s
->
streams
[
0
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
&&
s
->
streams
[
1
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
))
&&
s
->
streams
[
1
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
&&
s
->
streams
[
0
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_DATA
&&
s
->
streams
[
1
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_DATA
))
s
->
ctx_flags
&=
~
AVFMTCTX_NOHEADER
;
s
->
ctx_flags
&=
~
AVFMTCTX_NOHEADER
;
if
(
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
if
(
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
st
->
codecpar
->
bit_rate
=
flv
->
audio_bit_rate
;
st
->
codecpar
->
bit_rate
=
flv
->
audio_bit_rate
;
...
@@ -1001,7 +1003,7 @@ retry:
...
@@ -1001,7 +1003,7 @@ retry:
int
type
;
int
type
;
meta_pos
=
avio_tell
(
s
->
pb
);
meta_pos
=
avio_tell
(
s
->
pb
);
type
=
flv_read_metabody
(
s
,
next
);
type
=
flv_read_metabody
(
s
,
next
);
if
(
type
==
0
&&
dts
==
0
||
type
<
0
||
type
==
TYPE_UNKNOWN
)
{
if
(
type
==
0
&&
dts
==
0
||
type
<
0
)
{
if
(
type
<
0
&&
flv
->
validate_count
&&
if
(
type
<
0
&&
flv
->
validate_count
&&
flv
->
validate_index
[
0
].
pos
>
next
&&
flv
->
validate_index
[
0
].
pos
>
next
&&
flv
->
validate_index
[
0
].
pos
-
4
<
next
flv
->
validate_index
[
0
].
pos
-
4
<
next
...
@@ -1015,6 +1017,8 @@ retry:
...
@@ -1015,6 +1017,8 @@ retry:
return
flv_data_packet
(
s
,
pkt
,
dts
,
next
);
return
flv_data_packet
(
s
,
pkt
,
dts
,
next
);
}
else
if
(
type
==
TYPE_ONCAPTION
)
{
}
else
if
(
type
==
TYPE_ONCAPTION
)
{
return
flv_data_packet
(
s
,
pkt
,
dts
,
next
);
return
flv_data_packet
(
s
,
pkt
,
dts
,
next
);
}
else
if
(
type
==
TYPE_UNKNOWN
)
{
stream_type
=
FLV_STREAM_TYPE_DATA
;
}
}
avio_seek
(
s
->
pb
,
meta_pos
,
SEEK_SET
);
avio_seek
(
s
->
pb
,
meta_pos
,
SEEK_SET
);
}
}
...
@@ -1054,10 +1058,13 @@ skip:
...
@@ -1054,10 +1058,13 @@ skip:
}
else
if
(
stream_type
==
FLV_STREAM_TYPE_SUBTITLE
)
{
}
else
if
(
stream_type
==
FLV_STREAM_TYPE_SUBTITLE
)
{
if
(
st
->
codecpar
->
codec_type
==
AVMEDIA_TYPE_SUBTITLE
)
if
(
st
->
codecpar
->
codec_type
==
AVMEDIA_TYPE_SUBTITLE
)
break
;
break
;
}
else
if
(
stream_type
==
FLV_STREAM_TYPE_DATA
)
{
if
(
st
->
codecpar
->
codec_type
==
AVMEDIA_TYPE_DATA
)
break
;
}
}
}
}
if
(
i
==
s
->
nb_streams
)
{
if
(
i
==
s
->
nb_streams
)
{
static
const
enum
AVMediaType
stream_types
[]
=
{
AVMEDIA_TYPE_VIDEO
,
AVMEDIA_TYPE_AUDIO
,
AVMEDIA_TYPE_SUBTITLE
};
static
const
enum
AVMediaType
stream_types
[]
=
{
AVMEDIA_TYPE_VIDEO
,
AVMEDIA_TYPE_AUDIO
,
AVMEDIA_TYPE_SUBTITLE
,
AVMEDIA_TYPE_DATA
};
st
=
create_stream
(
s
,
stream_types
[
stream_type
]);
st
=
create_stream
(
s
,
stream_types
[
stream_type
]);
if
(
!
st
)
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
...
@@ -1153,6 +1160,8 @@ retry_duration:
...
@@ -1153,6 +1160,8 @@ retry_duration:
size
-=
ret
;
size
-=
ret
;
}
else
if
(
stream_type
==
FLV_STREAM_TYPE_SUBTITLE
)
{
}
else
if
(
stream_type
==
FLV_STREAM_TYPE_SUBTITLE
)
{
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_TEXT
;
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_TEXT
;
}
else
if
(
stream_type
==
FLV_STREAM_TYPE_DATA
)
{
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_NONE
;
// Opaque AMF data
}
}
if
(
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_AAC
||
if
(
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_AAC
||
...
@@ -1253,7 +1262,8 @@ retry_duration:
...
@@ -1253,7 +1262,8 @@ retry_duration:
if
(
stream_type
==
FLV_STREAM_TYPE_AUDIO
||
if
(
stream_type
==
FLV_STREAM_TYPE_AUDIO
||
((
flags
&
FLV_VIDEO_FRAMETYPE_MASK
)
==
FLV_FRAME_KEY
)
||
((
flags
&
FLV_VIDEO_FRAMETYPE_MASK
)
==
FLV_FRAME_KEY
)
||
stream_type
==
FLV_STREAM_TYPE_SUBTITLE
)
stream_type
==
FLV_STREAM_TYPE_SUBTITLE
||
stream_type
==
FLV_STREAM_TYPE_DATA
)
pkt
->
flags
|=
AV_PKT_FLAG_KEY
;
pkt
->
flags
|=
AV_PKT_FLAG_KEY
;
leave:
leave:
...
...
libavformat/version.h
View file @
d7638d8d
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
#define LIBAVFORMAT_VERSION_MAJOR 58
#define LIBAVFORMAT_VERSION_MINOR 2
1
#define LIBAVFORMAT_VERSION_MINOR 2
2
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
...
...
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