forked from FFmpeg/FFmpeg
Add latency check, the Media Kit shoul repport it, but this seems broken.
Originally committed as revision 1789 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
6af6cf22c5
commit
143d464416
1 changed files with 11 additions and 0 deletions
|
@ -38,6 +38,9 @@ extern "C" {
|
||||||
/* enable performance checks */
|
/* enable performance checks */
|
||||||
//#define PERF_CHECK
|
//#define PERF_CHECK
|
||||||
|
|
||||||
|
/* enable Media Kit latency checks */
|
||||||
|
//#define LATENCY_CHECK
|
||||||
|
|
||||||
#define AUDIO_BLOCK_SIZE 4096
|
#define AUDIO_BLOCK_SIZE 4096
|
||||||
//#define AUDIO_BLOCK_SIZE 2048
|
//#define AUDIO_BLOCK_SIZE 2048
|
||||||
#define AUDIO_BLOCK_COUNT 8
|
#define AUDIO_BLOCK_COUNT 8
|
||||||
|
@ -300,6 +303,10 @@ static int audio_write_packet(AVFormatContext *s1, int stream_index,
|
||||||
{
|
{
|
||||||
AudioData *s = (AudioData *)s1->priv_data;
|
AudioData *s = (AudioData *)s1->priv_data;
|
||||||
int len, ret;
|
int len, ret;
|
||||||
|
#ifdef LATENCY_CHECK
|
||||||
|
bigtime_t lat1, lat2;
|
||||||
|
lat1 = s->player->Latency();
|
||||||
|
#endif
|
||||||
#ifdef PERF_CHECK
|
#ifdef PERF_CHECK
|
||||||
bigtime_t t = s->starve_time;
|
bigtime_t t = s->starve_time;
|
||||||
s->starve_time = 0;
|
s->starve_time = 0;
|
||||||
|
@ -322,6 +329,10 @@ static int audio_write_packet(AVFormatContext *s1, int stream_index,
|
||||||
buf += len;
|
buf += len;
|
||||||
size -= len;
|
size -= len;
|
||||||
}
|
}
|
||||||
|
#ifdef LATENCY_CHECK
|
||||||
|
lat2 = s->player->Latency();
|
||||||
|
printf("#### BSoundPlayer::Latency(): before= %lld, after= %lld\n", lat1, lat2);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue