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
ac923ed4
Commit
ac923ed4
authored
Feb 07, 2015
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/mlv: Only add streams that are supposed to contain frames.
Fixes ticket #4296. Reviewed-by: Peter Ross
parent
ec8ec999
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
mlvdec.c
libavformat/mlvdec.c
+10
-13
No files found.
libavformat/mlvdec.c
View file @
ac923ed4
...
...
@@ -242,6 +242,7 @@ static int read_header(AVFormatContext *avctx)
AVIOContext
*
pb
=
avctx
->
pb
;
AVStream
*
vst
=
NULL
,
*
ast
=
NULL
;
int
size
,
ret
;
unsigned
nb_video_frames
,
nb_audio_frames
;
uint64_t
guid
;
char
guidstr
[
32
];
...
...
@@ -259,11 +260,17 @@ static int read_header(AVFormatContext *avctx)
avio_skip
(
pb
,
8
);
//fileNum, fileCount, fileFlags
mlv
->
class
[
0
]
=
avio_rl16
(
pb
);
if
(
mlv
->
class
[
0
])
{
mlv
->
class
[
1
]
=
avio_rl16
(
pb
);
nb_video_frames
=
avio_rl32
(
pb
);
nb_audio_frames
=
avio_rl32
(
pb
);
if
(
nb_video_frames
&&
mlv
->
class
[
0
])
{
vst
=
avformat_new_stream
(
avctx
,
NULL
);
if
(
!
vst
)
return
AVERROR
(
ENOMEM
);
vst
->
id
=
0
;
vst
->
nb_frames
=
nb_video_frames
;
if
((
mlv
->
class
[
0
]
&
(
MLV_CLASS_FLAG_DELTA
|
MLV_CLASS_FLAG_LZMA
)))
avpriv_request_sample
(
avctx
,
"compression"
);
vst
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
...
...
@@ -289,12 +296,12 @@ static int read_header(AVFormatContext *avctx)
}
}
mlv
->
class
[
1
]
=
avio_rl16
(
pb
);
if
(
mlv
->
class
[
1
])
{
if
(
nb_audio_frames
&&
mlv
->
class
[
1
])
{
ast
=
avformat_new_stream
(
avctx
,
NULL
);
if
(
!
ast
)
return
AVERROR
(
ENOMEM
);
ast
->
id
=
1
;
ast
->
nb_frames
=
nb_audio_frames
;
if
((
mlv
->
class
[
1
]
&
MLV_CLASS_FLAG_LZMA
))
avpriv_request_sample
(
avctx
,
"compression"
);
if
((
mlv
->
class
[
1
]
&
~
MLV_CLASS_FLAG_LZMA
)
!=
MLV_AUDIO_CLASS_WAV
)
...
...
@@ -304,16 +311,6 @@ static int read_header(AVFormatContext *avctx)
avpriv_set_pts_info
(
ast
,
33
,
1
,
ast
->
codec
->
sample_rate
);
}
if
(
vst
)
vst
->
nb_frames
=
avio_rl32
(
pb
);
else
avio_skip
(
pb
,
4
);
if
(
ast
)
ast
->
nb_frames
=
avio_rl32
(
pb
);
else
avio_skip
(
pb
,
4
);
if
(
vst
)
{
AVRational
framerate
;
framerate
.
num
=
avio_rl32
(
pb
);
...
...
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