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
d7d3efae
Commit
d7d3efae
authored
Dec 23, 2006
by
Oded Shimon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync to libnut, nom->num
Originally committed as revision 7367 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
3a1018d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
libnut.c
libavformat/libnut.c
+9
-9
No files found.
libavformat/libnut.c
View file @
d7d3efae
...
@@ -48,7 +48,7 @@ static int nut_write_header(AVFormatContext * avf) {
...
@@ -48,7 +48,7 @@ static int nut_write_header(AVFormatContext * avf) {
AVCodecContext
*
codec
=
avf
->
streams
[
i
]
->
codec
;
AVCodecContext
*
codec
=
avf
->
streams
[
i
]
->
codec
;
int
j
;
int
j
;
int
fourcc
=
0
;
int
fourcc
=
0
;
int
n
o
m
,
denom
,
ssize
;
int
n
u
m
,
denom
,
ssize
;
s
[
i
].
type
=
codec
->
codec_type
==
CODEC_TYPE_VIDEO
?
NUT_VIDEO_CLASS
:
NUT_AUDIO_CLASS
;
s
[
i
].
type
=
codec
->
codec_type
==
CODEC_TYPE_VIDEO
?
NUT_VIDEO_CLASS
:
NUT_AUDIO_CLASS
;
...
@@ -64,11 +64,11 @@ static int nut_write_header(AVFormatContext * avf) {
...
@@ -64,11 +64,11 @@ static int nut_write_header(AVFormatContext * avf) {
s
[
i
].
fourcc
=
av_malloc
(
s
[
i
].
fourcc_len
);
s
[
i
].
fourcc
=
av_malloc
(
s
[
i
].
fourcc_len
);
for
(
j
=
0
;
j
<
s
[
i
].
fourcc_len
;
j
++
)
s
[
i
].
fourcc
[
j
]
=
(
fourcc
>>
(
j
*
8
))
&
0xFF
;
for
(
j
=
0
;
j
<
s
[
i
].
fourcc_len
;
j
++
)
s
[
i
].
fourcc
[
j
]
=
(
fourcc
>>
(
j
*
8
))
&
0xFF
;
ff_parse_specific_params
(
codec
,
&
n
o
m
,
&
ssize
,
&
denom
);
ff_parse_specific_params
(
codec
,
&
n
u
m
,
&
ssize
,
&
denom
);
av_set_pts_info
(
avf
->
streams
[
i
],
60
,
denom
,
n
o
m
);
av_set_pts_info
(
avf
->
streams
[
i
],
60
,
denom
,
n
u
m
);
s
[
i
].
time_base
.
n
o
m
=
denom
;
s
[
i
].
time_base
.
n
u
m
=
denom
;
s
[
i
].
time_base
.
den
=
n
o
m
;
s
[
i
].
time_base
.
den
=
n
u
m
;
s
[
i
].
fixed_fps
=
0
;
s
[
i
].
fixed_fps
=
0
;
s
[
i
].
decode_delay
=
codec
->
has_b_frames
;
s
[
i
].
decode_delay
=
codec
->
has_b_frames
;
...
@@ -82,7 +82,7 @@ static int nut_write_header(AVFormatContext * avf) {
...
@@ -82,7 +82,7 @@ static int nut_write_header(AVFormatContext * avf) {
s
[
i
].
sample_height
=
0
;
s
[
i
].
sample_height
=
0
;
s
[
i
].
colorspace_type
=
0
;
s
[
i
].
colorspace_type
=
0
;
}
else
{
}
else
{
s
[
i
].
samplerate_n
o
m
=
codec
->
sample_rate
;
s
[
i
].
samplerate_n
u
m
=
codec
->
sample_rate
;
s
[
i
].
samplerate_denom
=
1
;
s
[
i
].
samplerate_denom
=
1
;
s
[
i
].
channel_count
=
codec
->
channels
;
s
[
i
].
channel_count
=
codec
->
channels
;
}
}
...
@@ -199,7 +199,7 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
...
@@ -199,7 +199,7 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
memcpy
(
st
->
codec
->
extradata
,
s
[
i
].
codec_specific
,
st
->
codec
->
extradata_size
);
memcpy
(
st
->
codec
->
extradata
,
s
[
i
].
codec_specific
,
st
->
codec
->
extradata_size
);
}
}
av_set_pts_info
(
avf
->
streams
[
i
],
60
,
s
[
i
].
time_base
.
n
o
m
,
s
[
i
].
time_base
.
den
);
av_set_pts_info
(
avf
->
streams
[
i
],
60
,
s
[
i
].
time_base
.
n
u
m
,
s
[
i
].
time_base
.
den
);
st
->
start_time
=
0
;
st
->
start_time
=
0
;
st
->
duration
=
s
[
i
].
max_pts
;
st
->
duration
=
s
[
i
].
max_pts
;
...
@@ -211,7 +211,7 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
...
@@ -211,7 +211,7 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
if
(
st
->
codec
->
codec_id
==
CODEC_ID_NONE
)
st
->
codec
->
codec_id
=
codec_get_wav_id
(
st
->
codec
->
codec_tag
);
if
(
st
->
codec
->
codec_id
==
CODEC_ID_NONE
)
st
->
codec
->
codec_id
=
codec_get_wav_id
(
st
->
codec
->
codec_tag
);
st
->
codec
->
channels
=
s
[
i
].
channel_count
;
st
->
codec
->
channels
=
s
[
i
].
channel_count
;
st
->
codec
->
sample_rate
=
s
[
i
].
samplerate_n
o
m
/
s
[
i
].
samplerate_denom
;
st
->
codec
->
sample_rate
=
s
[
i
].
samplerate_n
u
m
/
s
[
i
].
samplerate_denom
;
break
;
break
;
case
NUT_VIDEO_CLASS
:
case
NUT_VIDEO_CLASS
:
st
->
codec
->
codec_type
=
CODEC_TYPE_VIDEO
;
st
->
codec
->
codec_type
=
CODEC_TYPE_VIDEO
;
...
@@ -255,7 +255,7 @@ static int nut_read_packet(AVFormatContext * avf, AVPacket * pkt) {
...
@@ -255,7 +255,7 @@ static int nut_read_packet(AVFormatContext * avf, AVPacket * pkt) {
static
int
nut_read_seek
(
AVFormatContext
*
avf
,
int
stream_index
,
int64_t
target_ts
,
int
flags
)
{
static
int
nut_read_seek
(
AVFormatContext
*
avf
,
int
stream_index
,
int64_t
target_ts
,
int
flags
)
{
NUTContext
*
priv
=
avf
->
priv_data
;
NUTContext
*
priv
=
avf
->
priv_data
;
int
active_streams
[]
=
{
stream_index
,
-
1
};
int
active_streams
[]
=
{
stream_index
,
-
1
};
double
time_pos
=
target_ts
*
priv
->
s
[
stream_index
].
time_base
.
n
o
m
/
(
double
)
priv
->
s
[
stream_index
].
time_base
.
den
;
double
time_pos
=
target_ts
*
priv
->
s
[
stream_index
].
time_base
.
n
u
m
/
(
double
)
priv
->
s
[
stream_index
].
time_base
.
den
;
if
(
nut_seek
(
priv
->
nut
,
time_pos
,
2
*!
(
flags
&
AVSEEK_FLAG_BACKWARD
),
active_streams
))
return
-
1
;
if
(
nut_seek
(
priv
->
nut
,
time_pos
,
2
*!
(
flags
&
AVSEEK_FLAG_BACKWARD
),
active_streams
))
return
-
1
;
...
...
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