diff libmpdemux/muxer_avi.c @ 19926:81714f6e2cb5

better rounding for audio_delay_fix in muxer_avi.c
author ods15
date Fri, 22 Sep 2006 10:27:17 +0000
parents a8e681ad7c90
children d7b2fa4c39da
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);
       }
   }