[vlc-commits] Ogg: implement SET_SEEKPOINT

Ludovic Fauvet git at videolan.org
Mon Jan 14 12:12:48 CET 2013


vlc | branch: master | Ludovic Fauvet <etix at videolan.org> | Mon Jan 14 11:59:08 2013 +0100| [d9b1afb30594f3dca65aa8ac7ef93b400f24faff] | committer: Jean-Baptiste Kempf

Ogg: implement SET_SEEKPOINT

Close #6895

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/ogg.c |   22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 563d898..b37dfb1 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -533,7 +533,27 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             const int i_seekpoint = (int)va_arg( args, int );
             if( i_seekpoint > p_sys->i_seekpoints )
                 return VLC_EGENERIC;
-            return VLC_EGENERIC;// Seek( p_demux, p_sys->pp_seekpoints[i_seekpoint]->i_time_offset );
+            if( p_sys->i_bos > 0 )
+            {
+                return VLC_EGENERIC;
+            }
+
+            for( i = 0; i < p_sys->i_streams; i++ )
+            {
+                logical_stream_t *p_stream = p_sys->pp_stream[i];
+
+                /* we'll trash all the data until we find the next pcr */
+                p_stream->b_reinit = true;
+                p_stream->i_pcr = -1;
+                p_stream->i_interpolated_pcr = -1;
+                p_stream->i_previous_granulepos = -1;
+                ogg_stream_reset( &p_stream->os );
+            }
+            ogg_sync_reset( &p_sys->oy );
+            int64_t i_block = p_sys->pp_seekpoints[i_seekpoint]->i_time_offset * p_sys->i_bitrate / INT64_C(8000000);
+            if( stream_Seek( p_demux->s, i_block ) )
+                return VLC_EGENERIC;
+            return VLC_SUCCESS;
         }
 
         default:



More information about the vlc-commits mailing list