[vlc-commits] mux:ogg: handle 100ns values as msftime_t

Steve Lhomme git at videolan.org
Tue Sep 18 15:56:00 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jun 13 10:15:00 2018 +0200| [a0e8ef73e0dbb90428804a110e79be498e1c7ef2] | committer: Steve Lhomme

mux:ogg: handle 100ns values as msftime_t

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

 modules/mux/ogg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/mux/ogg.c b/modules/mux/ogg.c
index 8b917b4f5b..e79a448509 100644
--- a/modules/mux/ogg.c
+++ b/modules/mux/ogg.c
@@ -419,7 +419,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
             }
             p_stream->p_oggds_header->i_size = 0 ;
             p_stream->p_oggds_header->i_time_unit =
-                     INT64_C(10000000) * p_stream->fmt.video.i_frame_rate_base /
+                     MSFTIME_FROM_SEC(1) * p_stream->fmt.video.i_frame_rate_base /
                      (int64_t)p_stream->fmt.video.i_frame_rate;
             p_stream->p_oggds_header->i_samples_per_unit = 1;
             p_stream->p_oggds_header->i_default_len = 1 ; /* ??? */
@@ -505,7 +505,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
             snprintf( buf, sizeof(buf), "%"PRIx16, i_tag );
             strncpy( p_stream->p_oggds_header->sub_type, buf, 4 );
 
-            p_stream->p_oggds_header->i_time_unit = INT64_C(10000000);
+            p_stream->p_oggds_header->i_time_unit = MSFTIME_FROM_SEC(1);
             p_stream->p_oggds_header->i_default_len = 1;
             p_stream->p_oggds_header->i_buffer_size = 30*1024 ;
             p_stream->p_oggds_header->i_samples_per_unit = p_input->p_fmt->audio.i_rate;
@@ -1721,7 +1721,7 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
             ( ( ( p_stream->i_num_frames - p_stream->i_last_keyframe ) & 0x07FFFFFF ) << 3 );
         }
         else if( p_stream->p_oggds_header )
-            op.granulepos = ( p_data->i_dts - p_sys->i_start_dts ) * INT64_C(10) /
+            op.granulepos = MSFTIME_FROM_VLC_TICK( p_data->i_dts - p_sys->i_start_dts ) /
                 p_stream->p_oggds_header->i_time_unit;
     }
     else if( p_stream->fmt.i_cat == SPU_ES )



More information about the vlc-commits mailing list