mirror of
https://github.com/mpv-player/mpv
synced 2024-12-18 04:45:33 +00:00
demux: cosmetics: minimize code
This commit is contained in:
parent
8d40b1e8ab
commit
85eb2bee3a
@ -126,22 +126,9 @@ struct sh_stream *new_sh_stream(demuxer_t *demuxer, enum stream_type type)
|
|||||||
};
|
};
|
||||||
MP_TARRAY_APPEND(demuxer, demuxer->streams, demuxer->num_streams, sh);
|
MP_TARRAY_APPEND(demuxer, demuxer->streams, demuxer->num_streams, sh);
|
||||||
switch (sh->type) {
|
switch (sh->type) {
|
||||||
case STREAM_VIDEO: {
|
case STREAM_VIDEO: sh->video = talloc_zero(demuxer, struct sh_video); break;
|
||||||
struct sh_video *sht = talloc_zero(demuxer, struct sh_video);
|
case STREAM_AUDIO: sh->audio = talloc_zero(demuxer, struct sh_audio); break;
|
||||||
sh->video = sht;
|
case STREAM_SUB: sh->sub = talloc_zero(demuxer, struct sh_sub); break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
case STREAM_AUDIO: {
|
|
||||||
struct sh_audio *sht = talloc_zero(demuxer, struct sh_audio);
|
|
||||||
sh->audio = sht;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case STREAM_SUB: {
|
|
||||||
struct sh_sub *sht = talloc_zero(demuxer, struct sh_sub);
|
|
||||||
sh->sub = sht;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: assert(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sh->ds->selected = demuxer->stream_autoselect;
|
sh->ds->selected = demuxer->stream_autoselect;
|
||||||
|
Loading…
Reference in New Issue
Block a user