while len frames demuxer parse if frames for frame in frames if dec is

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
while len(s):
frames = demuxer.parse(s)
if frames:
for frame in frames:
if dec is None:
dec = acodec.Decoder(demuxer.streams[frame[0]])
raw = dec.decode(frame[1])
if raw and raw.data:
if self.snd is None:
self.snd = sound.Output(int(raw.sample_rate), raw.channels, sound.AFMT_S16_LE, self.card )
self.snd.play(raw.data)
s = buffer.read(512)