]> git.sesse.net Git - vlc/commitdiff
use CLOCK_FREQ
authorIlkka Ollakka <ileoo@videolan.org>
Fri, 21 Mar 2014 09:12:34 +0000 (11:12 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Sun, 21 Sep 2014 10:37:11 +0000 (11:37 +0100)
modules/codec/twolame.c
modules/codec/x264.c

index 4abc72b38ce16be64c44d68df7fbccdd67dbc9e5..20ef952b1423b5f6e07333df6e00019ada558e14 100644 (file)
@@ -275,7 +275,7 @@ static block_t *Encode( encoder_t *p_enc, block_t *p_aout_buf )
 
         p_block = block_Alloc( i_used );
         memcpy( p_block->p_buffer, p_sys->p_out_buffer, i_used );
-        p_block->i_length = (mtime_t)1000000 *
+        p_block->i_length = CLOCK_FREQ *
                 (mtime_t)MPEG_FRAME_SIZE / (mtime_t)p_enc->fmt_out.audio.i_rate;
         p_block->i_dts = p_block->i_pts = p_sys->i_pts;
         p_sys->i_pts += p_block->i_length;
@@ -305,7 +305,7 @@ static block_t *Encode( encoder_t *p_enc, block_t *p_aout_buf )
         p_sys->i_nb_samples = 0;
         p_block = block_Alloc( i_used );
         memcpy( p_block->p_buffer, p_sys->p_out_buffer, i_used );
-        p_block->i_length = (mtime_t)1000000 *
+        p_block->i_length = CLOCK_FREQ *
                 (mtime_t)MPEG_FRAME_SIZE / (mtime_t)p_enc->fmt_out.audio.i_rate;
         p_block->i_dts = p_block->i_pts = p_sys->i_pts;
         p_sys->i_pts += p_block->i_length;
index b7778c18f9b3d159ff30c4a3f1edf5eae8b98e6a..9ade8973f27288d7a2ce91302189e720a344e8d2 100644 (file)
@@ -1289,7 +1289,7 @@ static int  Open ( vlc_object_t *p_this )
         p_sys->param.i_fps_num = p_enc->fmt_in.video.i_frame_rate;
         p_sys->param.i_fps_den = p_enc->fmt_in.video.i_frame_rate_base;
         p_sys->param.i_timebase_num = 1;
-        p_sys->param.i_timebase_den = INT64_C(1000000);
+        p_sys->param.i_timebase_den = CLOCK_FREQ;
         p_sys->param.b_vfr_input = 0;
     }
 
@@ -1541,7 +1541,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pict )
         p_block->i_flags |= BLOCK_FLAG_TYPE_PB;
 
     /* This isn't really valid for streams with B-frames */
-    p_block->i_length = INT64_C(1000000) *
+    p_block->i_length = CLOCK_FREQ *
         p_enc->fmt_in.video.i_frame_rate_base /
             p_enc->fmt_in.video.i_frame_rate;