Browse Source

libobs: Log milliseconds of audio buffering, not ticks

Makes the log message a bit less confusing
jp9000 10 years ago
parent
commit
7db6a4d5bd
1 changed files with 9 additions and 2 deletions
  1. 9 2
      libobs/obs-audio.c

+ 9 - 2
libobs/obs-audio.c

@@ -221,6 +221,8 @@ static void add_audio_buffering(struct obs_core_audio *audio,
 	struct ts_info new_ts;
 	uint64_t offset;
 	uint64_t frames;
+	size_t total_ms;
+	size_t ms;
 	int ticks;
 
 	if (audio->total_buffering_ticks == MAX_BUFFERING_TICKS)
@@ -241,8 +243,13 @@ static void add_audio_buffering(struct obs_core_audio *audio,
 		blog(LOG_WARNING, "Max audio buffering reached!");
 	}
 
-	blog(LOG_INFO, "adding %d ticks of buffering, total buffering is "
-			"now %d", ticks, audio->total_buffering_ticks);
+	ms = ticks * AUDIO_OUTPUT_FRAMES * 1000 / sample_rate;
+	total_ms = audio->total_buffering_ticks * AUDIO_OUTPUT_FRAMES * 1000 /
+		sample_rate;
+
+	blog(LOG_INFO, "adding %d milliseconds of audio buffering, total "
+			"audio buffering is now %d milliseconds",
+			(int)ms, (int)total_ms);
 #if DEBUG_AUDIO == 1
 	blog(LOG_DEBUG, "min_ts (%"PRIu64") < start timestamp "
 			"(%"PRIu64")", min_ts, ts->start);