]> git.sesse.net Git - vlc/commitdiff
transcode: reset audio pts when samplerate changes and set it on module open
authorIlkka Ollakka <ileoo@videolan.org>
Fri, 24 Jan 2014 15:48:08 +0000 (17:48 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Sat, 25 Jan 2014 08:15:37 +0000 (10:15 +0200)
modules/stream_out/transcode/audio.c

index 07f3094fe4dc50cb73ce1dc5e17350c5419d8797..7529ff79aa33935e6b5104b1afa73a882846394c 100644 (file)
@@ -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 )