[vlc-devel] [PATCH 6/9] demux: mkv: fix unscoped switch-case body
Filip Roséen
filip at atch.se
Mon Jul 16 05:19:54 CEST 2018
A switch-case that introduces variables should be scoped, as it
otherwise is ill-formed to add another case after it.
---
modules/demux/mkv/mkv.cpp | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index c0184db280..4400198778 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -638,11 +638,13 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
break;
case VLC_CODEC_OPUS:
- vlc_tick_t i_length = i_duration * track. f_timecodescale *
- (double) p_segment->i_timescale / 1000.0;
- if ( i_length < 0 ) i_length = 0;
- p_block->i_nb_samples = i_length * track.fmt.audio.i_rate
- / CLOCK_FREQ;
+ {
+ vlc_tick_t i_length = i_duration * track. f_timecodescale *
+ (double) p_segment->i_timescale / 1000.0;
+ if ( i_length < 0 ) i_length = 0;
+ p_block->i_nb_samples = i_length * track.fmt.audio.i_rate
+ / CLOCK_FREQ;
+ }
break;
}
--
2.18.0
More information about the vlc-devel
mailing list