Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
91b6f326
Commit
91b6f326
authored
Jul 27, 2005
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/stream_out/transcode.c: Attempt at having --sout-transcode-fps
output correct timestamps.
parent
5c8acc49
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
48 deletions
+50
-48
modules/stream_out/transcode.c
modules/stream_out/transcode.c
+50
-48
No files found.
modules/stream_out/transcode.c
View file @
91b6f326
...
...
@@ -897,28 +897,6 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
if
(
!
id
->
b_transcode
&&
id
->
id
)
{
if
(
p_sys
->
b_master_sync
&&
p_sys
->
i_master_drift
)
{
if
(
p_buffer
->
i_dts
>
0
)
{
p_buffer
->
i_dts
-=
p_sys
->
i_master_drift
;
if
(
p_buffer
->
i_dts
<
0
)
{
block_Release
(
p_buffer
);
return
VLC_EGENERIC
;
}
}
if
(
p_buffer
->
i_pts
>
0
)
{
p_buffer
->
i_pts
-=
p_sys
->
i_master_drift
;
if
(
p_buffer
->
i_pts
<
0
)
{
block_Release
(
p_buffer
);
return
VLC_EGENERIC
;
}
}
}
return
p_sys
->
p_out
->
pf_send
(
p_sys
->
p_out
,
id
->
id
,
p_buffer
);
}
else
if
(
!
id
->
b_transcode
)
...
...
@@ -1223,6 +1201,11 @@ static int transcode_audio_process( sout_stream_t *p_stream,
if
(
p_sys
->
b_master_sync
)
{
mtime_t
i_dts
=
date_Get
(
&
id
->
interpolated_pts
)
+
1
;
if
(
i_dts
==
1
)
{
date_Set
(
&
id
->
interpolated_pts
,
p_audio_buf
->
start_date
);
i_dts
=
p_audio_buf
->
start_date
+
1
;
}
p_sys
->
i_master_drift
=
p_audio_buf
->
start_date
-
i_dts
;
date_Increment
(
&
id
->
interpolated_pts
,
p_audio_buf
->
i_nb_samples
);
p_audio_buf
->
start_date
-=
p_sys
->
i_master_drift
;
...
...
@@ -1409,8 +1392,6 @@ static int transcode_video_new( sout_stream_t *p_stream, sout_stream_id_t *id )
}
}
date_Set
(
&
id
->
interpolated_pts
,
0
);
return
VLC_SUCCESS
;
}
...
...
@@ -1627,13 +1608,12 @@ static int transcode_video_process( sout_stream_t *p_stream,
mtime_t
i_master_drift
=
p_sys
->
i_master_drift
;
mtime_t
i_pts
;
if
(
!
i_master_drift
)
i_pts
=
date_Get
(
&
id
->
interpolated_pts
)
+
1
;
if
(
i_pts
==
1
)
{
/* No audio track ? */
p_sys
->
i_master_drift
=
i_master_drift
=
p_pic
->
date
;
date_Set
(
&
id
->
interpolated_pts
,
p_pic
->
date
);
i_pts
=
p_pic
->
date
+
1
;
}
i_pts
=
date_Get
(
&
id
->
interpolated_pts
)
+
1
;
i_video_drift
=
p_pic
->
date
-
i_pts
;
i_duplicate
=
1
;
...
...
@@ -1864,22 +1844,57 @@ static int transcode_video_process( sout_stream_t *p_stream,
block_t
*
p_block
;
p_block
=
id
->
p_encoder
->
pf_encode_video
(
id
->
p_encoder
,
p_pic
);
block_ChainAppend
(
out
,
p_block
);
}
if
(
p_sys
->
b_master_sync
)
{
mtime_t
i_pts
=
date_Get
(
&
id
->
interpolated_pts
)
+
1
;
if
(
i_pts
==
1
)
{
date_Set
(
&
id
->
interpolated_pts
,
p_pic
->
date
);
i_pts
=
p_pic
->
date
+
1
;
}
date_Increment
(
&
id
->
interpolated_pts
,
1
);
}
if
(
p_sys
->
b_master_sync
&&
i_duplicate
>
1
)
{
mtime_t
i_pts
=
date_Get
(
&
id
->
interpolated_pts
)
+
1
;
if
(
i_pts
==
1
)
{
date_Set
(
&
id
->
interpolated_pts
,
p_pic
->
date
);
i_pts
=
p_pic
->
date
+
1
;
}
date_Increment
(
&
id
->
interpolated_pts
,
1
);
if
(
p_sys
->
i_threads
>=
1
)
{
/* We can't modify the picture, we need to duplicate it */
picture_t
*
p_tmp
=
video_new_buffer_decoder
(
id
->
p_decoder
);
if
(
p_tmp
!=
NULL
)
{
vout_CopyPicture
(
p_stream
,
p_tmp
,
p_pic
);
p_pic
=
p_tmp
;
vlc_mutex_lock
(
&
p_sys
->
lock_out
);
p_sys
->
pp_pics
[
p_sys
->
i_last_pic
++
]
=
p_pic
;
p_sys
->
i_last_pic
%=
PICTURE_RING_SIZE
;
vlc_cond_signal
(
&
p_sys
->
cond
);
vlc_mutex_unlock
(
&
p_sys
->
lock_out
);
}
}
else
{
block_t
*
p_block
;
p_pic
->
date
=
i_pts
;
p_block
=
id
->
p_encoder
->
pf_encode_video
(
id
->
p_encoder
,
p_pic
);
block_ChainAppend
(
out
,
p_block
);
}
}
if
(
p_sys
->
i_threads
==
0
)
p_pic
->
pf_release
(
p_pic
);
}
}
return
VLC_SUCCESS
;
}
...
...
@@ -1913,19 +1928,6 @@ static int EncoderThread( sout_stream_sys_t *p_sys )
vlc_mutex_lock
(
&
p_sys
->
lock_out
);
block_ChainAppend
(
&
p_sys
->
p_buffers
,
p_block
);
if
(
p_sys
->
b_master_sync
)
date_Increment
(
&
id
->
interpolated_pts
,
1
);
#if 0
if( p_sys->b_master_sync && i_duplicate > 1 )
{
mtime_t i_pts = date_Get( &id->interpolated_pts ) + 1;
date_Increment( &id->interpolated_pts, 1 );
p_pic->date = i_pts;
p_block = id->p_encoder->pf_encode_video(id->p_encoder, p_pic);
block_ChainAppend( &p_sys->p_buffers, p_block );
}
#endif
vlc_mutex_unlock
(
&
p_sys
->
lock_out
);
p_pic
->
pf_release
(
p_pic
);
...
...
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