mirror of https://github.com/mpv-player/mpv
ao_audiotrack: support delay up to 2s as normal
Fixes issues streaming to echo speaker pair from firetv devices. Signed-off-by: Aman Karmani <aman@tmm1.net>
This commit is contained in:
parent
432c0255bc
commit
6473711dce
|
@ -479,12 +479,12 @@ static double AudioTrack_getLatency(struct ao *ao)
|
||||||
if (!p->timestamp_set &&
|
if (!p->timestamp_set &&
|
||||||
p->format != AudioFormat.ENCODING_IEC61937)
|
p->format != AudioFormat.ENCODING_IEC61937)
|
||||||
delay += (double)MP_JNI_CALL_INT(p->audiotrack, AudioTrack.getLatency)/1000.0;
|
delay += (double)MP_JNI_CALL_INT(p->audiotrack, AudioTrack.getLatency)/1000.0;
|
||||||
if (delay > 1.0) {
|
if (delay > 2.0) {
|
||||||
//MP_WARN(ao, "getLatency: written=%u playhead=%u diff=%u delay=%f\n", p->written_frames, playhead, diff, delay);
|
//MP_WARN(ao, "getLatency: written=%u playhead=%u diff=%u delay=%f\n", p->written_frames, playhead, diff, delay);
|
||||||
p->timestamp_fetched = 0;
|
p->timestamp_fetched = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return MPCLAMP(delay, 0.0, 1.0);
|
return MPCLAMP(delay, 0.0, 2.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int AudioTrack_write(struct ao *ao, int len)
|
static int AudioTrack_write(struct ao *ao, int len)
|
||||||
|
|
Loading…
Reference in New Issue