summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-05 16:55:43 +0200
committerwm4 <wm4@nowhere>2014-07-05 17:07:15 +0200
commit85eb2bee3a25f34984cae919f3a8cd292fb92c31 (patch)
treee64c96acd0340e2012881abcbb7fd8196a519cd6
parent8d40b1e8ab2eeefae7a3bc20e176b2be707d3682 (diff)
downloadmpv-85eb2bee3a25f34984cae919f3a8cd292fb92c31.tar.bz2
mpv-85eb2bee3a25f34984cae919f3a8cd292fb92c31.tar.xz
demux: cosmetics: minimize code
-rw-r--r--demux/demux.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 9884f91845..f3e57944d4 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -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);
switch (sh->type) {
- case STREAM_VIDEO: {
- struct sh_video *sht = talloc_zero(demuxer, struct sh_video);
- sh->video = sht;
- 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);
+ case STREAM_VIDEO: sh->video = talloc_zero(demuxer, struct sh_video); break;
+ case STREAM_AUDIO: sh->audio = talloc_zero(demuxer, struct sh_audio); break;
+ case STREAM_SUB: sh->sub = talloc_zero(demuxer, struct sh_sub); break;
}
sh->ds->selected = demuxer->stream_autoselect;