changeset 19926:81714f6e2cb5

better rounding for audio_delay_fix in muxer_avi.c
author ods15
date Fri, 22 Sep 2006 10:27:17 +0000
parents 9055617d09ab
children 51551ba076d9
files libmpdemux/muxer_avi.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer_avi.c	Fri Sep 22 10:24:10 2006 +0000
+++ b/libmpdemux/muxer_avi.c	Fri Sep 22 10:27:17 2006 +0000
@@ -288,11 +288,11 @@
   for (i = 0; muxer->streams[i] && i < MUXER_MAX_STREAMS; ++i) {
       muxer_stream_t *s = muxer->streams[i];
       if (s->type == MUXER_TYPE_AUDIO && muxer->audio_delay_fix > 0.0) {
-          s->h.dwStart = muxer->audio_delay_fix * s->h.dwRate/s->h.dwScale;
+          s->h.dwStart = muxer->audio_delay_fix * s->h.dwRate/s->h.dwScale + 0.5;
           mp_msg(MSGT_MUXER, MSGL_INFO, MSGTR_SettingAudioDelay, (float)s->h.dwStart * s->h.dwScale/s->h.dwRate);
       }
       if (s->type == MUXER_TYPE_VIDEO && muxer->audio_delay_fix < 0.0) {
-          s->h.dwStart = -muxer->audio_delay_fix * s->h.dwRate/s->h.dwScale;
+          s->h.dwStart = -muxer->audio_delay_fix * s->h.dwRate/s->h.dwScale + 0.5;
           mp_msg(MSGT_MUXER, MSGL_INFO, MSGTR_SettingVideoDelay, (float)s->h.dwStart * s->h.dwScale/s->h.dwRate);
       }
   }