[vlc-devel] [PATCH] transcode: Correctly reset video drift

Aurélien Nephtali aurelien.nephtali at gmail.com
Thu Jun 7 20:29:35 CEST 2012


On Thu, Jun 7, 2012 at 7:02 PM, Rafaël Carré <funman at videolan.org> wrote:
>> From ec143e16e58df8db3e1d333191e15c944335cfc2 Mon Sep 17 00:00:00 2001
>> From: Aurelien Nephtali <aurelien.nephtali at gmail.com>
>> Date: Thu, 7 Jun 2012 17:39:20 +0200
>> Subject: [PATCH 1/2] transcode: Correctly reset video drift
>>
>> Broken since 5d34933a25c804a6467251e01567d289a64f6468
>> ---
>>  modules/stream_out/transcode/video.c |    1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
>> index 3ab053e..05a8821 100644
>> --- a/modules/stream_out/transcode/video.c
>> +++ b/modules/stream_out/transcode/video.c
>> @@ -728,6 +728,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
>>
>>              if( unlikely( b_need_duplicate ) )
>>              {
>> +                date_Increment( &id->interpolated_pts, 1 );
>>
>>                 if( p_sys->i_threads >= 1 )
>>                 {
>
> I don't really understand that code, usually I disable audio-sync since
> it seems to cause problems.
>
> Can you explain a bit what this change fixes?

Before 5d34933a25c804a6467251e01567d289a64f6468, there were 2
date_Increment() when the transcode module needed to duplicate a frame
: line 730 and 753
(http://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;a=blob;f=modules/stream_out/transcode/video.c;h=246d4eaa95e662b550d638dcf113f4708e93c9d9;hb=a01d5d94f9292d300411c67b30ce1075923a3080#l730)

I have a sample which without this patch has a i_video_drift
(p_pic->date - i_pts) stuck at 99998ms (max before resync being
100ms).
Each frame is then duplicated (b_duplicate is always true) until
another glitch in the stream happens (master drift is then > 100ms)
and the reset is done.

-- 
Aurélien Nephtali



More information about the vlc-devel mailing list