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
838ed296
Commit
838ed296
authored
Nov 27, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nuv: use the stream indices generated by avformat_new_stream()
parent
c74f8178
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
nuv.c
libavformat/nuv.c
+6
-5
No files found.
libavformat/nuv.c
View file @
838ed296
...
@@ -152,7 +152,6 @@ static int nuv_header(AVFormatContext *s)
...
@@ -152,7 +152,6 @@ static int nuv_header(AVFormatContext *s)
char
id_string
[
12
];
char
id_string
[
12
];
double
aspect
,
fps
;
double
aspect
,
fps
;
int
is_mythtv
,
width
,
height
,
v_packs
,
a_packs
;
int
is_mythtv
,
width
,
height
,
v_packs
,
a_packs
;
int
stream_nr
=
0
;
AVStream
*
vst
=
NULL
,
*
ast
=
NULL
;
AVStream
*
vst
=
NULL
,
*
ast
=
NULL
;
avio_read
(
pb
,
id_string
,
12
);
avio_read
(
pb
,
id_string
,
12
);
...
@@ -178,10 +177,11 @@ static int nuv_header(AVFormatContext *s)
...
@@ -178,10 +177,11 @@ static int nuv_header(AVFormatContext *s)
avio_rl32
(
pb
);
// keyframe distance (?)
avio_rl32
(
pb
);
// keyframe distance (?)
if
(
v_packs
)
{
if
(
v_packs
)
{
ctx
->
v_id
=
stream_nr
++
;
vst
=
avformat_new_stream
(
s
,
NULL
);
vst
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
vst
)
if
(
!
vst
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
ctx
->
v_id
=
vst
->
index
;
vst
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
vst
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
vst
->
codec
->
codec_id
=
AV_CODEC_ID_NUV
;
vst
->
codec
->
codec_id
=
AV_CODEC_ID_NUV
;
vst
->
codec
->
width
=
width
;
vst
->
codec
->
width
=
width
;
...
@@ -198,10 +198,11 @@ static int nuv_header(AVFormatContext *s)
...
@@ -198,10 +198,11 @@ static int nuv_header(AVFormatContext *s)
ctx
->
v_id
=
-
1
;
ctx
->
v_id
=
-
1
;
if
(
a_packs
)
{
if
(
a_packs
)
{
ctx
->
a_id
=
stream_nr
++
;
ast
=
avformat_new_stream
(
s
,
NULL
);
ast
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
ast
)
if
(
!
ast
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
ctx
->
a_id
=
ast
->
index
;
ast
->
codec
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
ast
->
codec
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
ast
->
codec
->
codec_id
=
AV_CODEC_ID_PCM_S16LE
;
ast
->
codec
->
codec_id
=
AV_CODEC_ID_PCM_S16LE
;
ast
->
codec
->
channels
=
2
;
ast
->
codec
->
channels
=
2
;
...
...
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