1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-29 10:32:15 +00:00

Make sure we do not hang if no streams are available

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21420 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2006-12-01 18:51:44 +00:00
parent d441d65f34
commit f32179337e

View File

@ -775,9 +775,13 @@ static int demux_avi_control(demuxer_t *demuxer,int cmd, void *arg){
if (*(int *)arg >= 0)
ds->id = *(int *)arg;
else {
int id = ds->id;
do {
if (++ds->id >= maxid) ds->id = 0;
} while (!streams[ds->id]);
if (++id >= maxid) id = 0;
if (id == ds->id) // no streams available
return DEMUXER_CTRL_NOTIMPL;
} while (!streams[id]);
ds->id = id;
}
chunkid = (ds->id / 10 + '0') | (ds->id % 10 + '0') << 8;