mattgallagher / AudioStreamer

A streaming audio player class (AudioStreamer) for Mac OS X and iPhone.
http://cocoawithlove.com
1.93k stars 553 forks source link

buffer problem #49

Closed jduffas closed 12 years ago

jduffas commented 12 years ago

hi ! great job, I use your code in a free app, to listen a radio, but I have a problem, when bandwidth is not good enough, buffer stops... I would like to have a new try when it happened... but I don't know how. because it stopes when length=0, I tried to change

if (length == 0) { return; }

into

if (length == 0) { [self failWithErrorCode:AS_AUDIO_DATA_NOT_FOUND]; [[NSNotificationCenter defaultCenter] postNotificationName:@"BWillReBuffer" object:nil];
return; }

with something like that in the iPhoneStreamingPlayerViewController :

but it didn't worked. it does call the reBuffer, but it freeze...

any idea ?

thank you.

jean

jduffas commented 12 years ago

finalement, j'ai fait totalement autrement, j'ai ajouté à la fin du destroy steamer ceci :

if (playing && stoped){ playing=TRUE; stoped=FALSE; [self createStreamer]; [self setButtonImage:[UIImage imageNamed:@"loadingbutton.png"]]; [streamer start]; [self webLoad];

}

avec ceci dans le AudioStream.m :

if (length == 0) {

            [self failWithErrorCode:AS_AUDIO_DATA_NOT_FOUND];
            stoped=TRUE;
            return;
        }