[vlc-commits] transcode: reset audio pts when samplerate changes and set it on module open

Ilkka Ollakka git at videolan.org
Sat Jan 25 09:16:17 CET 2014


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Fri Jan 24 17:48:08 2014 +0200| [945d6f4c851071ea739c64b32f0a59507d39ec82] | committer: Ilkka Ollakka

transcode: reset audio pts when samplerate changes and set it on module open

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=945d6f4c851071ea739c64b32f0a59507d39ec82
---

 modules/stream_out/transcode/audio.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index 07f3094..7529ff79 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -240,6 +240,7 @@ int transcode_audio_process( sout_stream_t *p_stream,
                           &id->p_decoder->fmt_out.audio ) != VLC_SUCCESS ) )
                 return VLC_EGENERIC;
             date_Init( &id->interpolated_pts, id->p_decoder->fmt_out.audio.i_rate, 1 );
+            date_Set( &id->interpolated_pts, p_audio_buf->i_pts );
         }
 
         /* Check if audio format has changed, and filters need reinit */
@@ -259,7 +260,8 @@ int transcode_audio_process( sout_stream_t *p_stream,
                 return VLC_EGENERIC;
 
             /* Set interpolated_pts to run with new samplerate */
-            date_Change( &id->interpolated_pts, p_sys->fmt_audio.i_rate, 1 );
+            date_Init( &id->interpolated_pts, p_sys->fmt_audio.i_rate, 1 );
+            date_Set( &id->interpolated_pts, p_audio_buf->i_pts );
         }
 
         if( p_sys->b_master_sync )



More information about the vlc-commits mailing list