[MPlayer-dev-eng] [PATCH] smooth playback with NAS and all audio drivers

Arpi arpi at thot.banki.hu
Tue Sep 24 00:01:11 CEST 2002


Hi,

>   o It also has 2 important fixes to the RTC sleep.  Just the minimal
>     changes were done this time, with everything left in mplayer.c.
>     The RTC returns a 32-bit number, but the read() was for a long long.
>     This had the effect of cutting the frequency in half (?), so now it
>     would probably work as well at 512Hz, causing half the number of
>     hardware interrupts.  I set it at 1024 anyway since that rate didn't
>     seem to be bringing anyone's machine to its knees.
i'll apply this part now

>   o Definitely no changes to setuid behavior this time.  The new call
>     to seteuid(0) before /dev/rtc is opened should not break anything
>     and will allow the RTC code to continue to work even if the line
>     "seteuid(getuid())" is added some day at the start of main().
please leave this euid thing until we decide to change it everywhere...

>   o The patch removes the dapsync code.  But I can generate a version
>     which leaves it in if you prefer?
dunno
i don't like it, dunno if anyone use it. i'l just remove now and we'll see :)

>   o A new variable "delay_avg" stores either the last delay measurement
>     from audio_out->get_delay(), or a corrected one calculated by my

the problem is here.
you should not store the result of audio_out->get_delay(), it's variable in
time. your patch gets (asks the audio driver) it after decoding a video
frame, saves it, and uses it after the audio decoding, ignoring all the
delay and buffer change caused by the audio decoding process. VERY BAD!
it may work with your avg'd values, but it will surely break the old timing
code, especially on slow systems.

also, i don't really understand why did you change this:

-       if(sh_audio && !d_audio->eof){
+       if(sh_audio && !d_audio->eof && delay_avg!=0){

(frame dropping entry contdition)

the delay caused by audio buffering has NOTHING with the video
frame dropping, imho.

>   There were several ways to write this patch, but I chose one which
>   makes it clear that all it does is adjust the delay that Arpi's sync

i wouldn't call it clear ...


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list