Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
ffmpeg
Commits
d7d3efae
Commit
d7d3efae
authored
Dec 23, 2006
by
Oded Shimon
Browse files
sync to libnut, nom->num
Originally committed as revision 7367 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
3a1018d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
libavformat/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) {
AVCodecContext
*
codec
=
avf
->
streams
[
i
]
->
codec
;
int
j
;
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
;
...
...
@@ -64,11 +64,11 @@ static int nut_write_header(AVFormatContext * avf) {
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
;
ff_parse_specific_params
(
codec
,
&
n
o
m
,
&
ssize
,
&
denom
);
av_set_pts_info
(
avf
->
streams
[
i
],
60
,
denom
,
n
o
m
);
ff_parse_specific_params
(
codec
,
&
n
u
m
,
&
ssize
,
&
denom
);
av_set_pts_info
(
avf
->
streams
[
i
],
60
,
denom
,
n
u
m
);
s
[
i
].
time_base
.
n
o
m
=
denom
;
s
[
i
].
time_base
.
den
=
n
o
m
;
s
[
i
].
time_base
.
n
u
m
=
denom
;
s
[
i
].
time_base
.
den
=
n
u
m
;
s
[
i
].
fixed_fps
=
0
;
s
[
i
].
decode_delay
=
codec
->
has_b_frames
;
...
...
@@ -82,7 +82,7 @@ static int nut_write_header(AVFormatContext * avf) {
s
[
i
].
sample_height
=
0
;
s
[
i
].
colorspace_type
=
0
;
}
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
].
channel_count
=
codec
->
channels
;
}
...
...
@@ -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
);
}
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
->
duration
=
s
[
i
].
max_pts
;
...
...
@@ -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
);
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
;
case
NUT_VIDEO_CLASS
:
st
->
codec
->
codec_type
=
CODEC_TYPE_VIDEO
;
...
...
@@ -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
)
{
NUTContext
*
priv
=
avf
->
priv_data
;
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
;
...
...
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