Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
623a50eb
Commit
623a50eb
authored
Oct 13, 2013
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: map AV_NOPTS_VALUE and VLC_TS_INVALID
parent
4f7537d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+15
-6
No files found.
modules/codec/avcodec/encoder.c
View file @
623a50eb
...
...
@@ -649,7 +649,7 @@ int OpenEncoder( vlc_object_t *p_this )
p_context
->
sample_rate
=
p_enc
->
fmt_out
.
audio
.
i_rate
;
date_Init
(
&
p_sys
->
buffer_date
,
p_enc
->
fmt_out
.
audio
.
i_rate
,
1
);
date_Set
(
&
p_sys
->
buffer_date
,
0
);
date_Set
(
&
p_sys
->
buffer_date
,
AV_NOPTS_VALUE
);
p_context
->
time_base
.
num
=
1
;
p_context
->
time_base
.
den
=
p_context
->
sample_rate
;
p_context
->
channels
=
p_enc
->
fmt_out
.
audio
.
i_channels
;
...
...
@@ -1187,7 +1187,8 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf )
p_aout_buf
->
p_buffer
+=
leftover
;
p_aout_buf
->
i_buffer
-=
leftover
;
p_aout_buf
->
i_pts
=
date_Get
(
&
p_sys
->
buffer_date
);
if
(
likely
(
p_sys
->
frame
->
pts
!=
(
int64_t
)
AV_NOPTS_VALUE
)
)
p_aout_buf
->
i_pts
=
date_Get
(
&
p_sys
->
buffer_date
);
}
if
(
unlikely
(
(
(
leftover
+
buffer_delay
)
<
p_sys
->
i_buffer_out
)
&&
...
...
@@ -1234,7 +1235,10 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf )
(
mtime_t
)
p_sys
->
frame
->
nb_samples
/
(
mtime_t
)
p_sys
->
p_context
->
sample_rate
;
p_block
->
i_dts
=
p_block
->
i_pts
=
packet
.
pts
;
if
(
likely
(
packet
.
pts
!=
(
int64_t
)
AV_NOPTS_VALUE
)
)
p_block
->
i_dts
=
p_block
->
i_pts
=
packet
.
pts
;
else
p_block
->
i_dts
=
p_block
->
i_pts
=
VLC_TS_INVALID
;
block_ChainAppend
(
&
p_chain
,
p_block
);
}
...
...
@@ -1256,7 +1260,10 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf )
(
mtime_t
)
p_sys
->
i_frame_size
/
(
mtime_t
)
p_sys
->
p_context
->
sample_rate
;
p_block
->
i_dts
=
p_block
->
i_pts
=
packet
.
pts
;
if
(
likely
(
packet
.
pts
!=
(
int64_t
)
AV_NOPTS_VALUE
)
)
p_block
->
i_dts
=
p_block
->
i_pts
=
packet
.
pts
;
else
p_block
->
i_dts
=
p_block
->
i_pts
=
VLC_TS_INVALID
;
if
(
i_out
>=
0
&&
got_packet
)
block_ChainAppend
(
&
p_chain
,
p_block
);
...
...
@@ -1305,7 +1312,6 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf )
p_aout_buf
->
i_nb_samples
-=
p_sys
->
frame
->
nb_samples
;
date_Increment
(
&
p_sys
->
buffer_date
,
p_sys
->
frame
->
nb_samples
);
p_block
=
block_Alloc
(
p_sys
->
i_buffer_out
);
av_init_packet
(
&
packet
);
packet
.
data
=
p_block
->
p_buffer
;
...
...
@@ -1331,7 +1337,10 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf )
(
mtime_t
)
p_sys
->
frame
->
nb_samples
/
(
mtime_t
)
p_sys
->
p_context
->
sample_rate
;
p_block
->
i_dts
=
p_block
->
i_pts
=
packet
.
pts
;
if
(
likely
(
packet
.
pts
!=
(
int64_t
)
AV_NOPTS_VALUE
)
)
p_block
->
i_dts
=
p_block
->
i_pts
=
packet
.
pts
;
else
p_block
->
i_dts
=
p_block
->
i_pts
=
VLC_TS_INVALID
;
block_ChainAppend
(
&
p_chain
,
p_block
);
}
...
...
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