Browse Source

rtpenc: Avoid brittle switch fallthroughs

Instead explicitly jump to the default case in the cases where
it is wanted, and avoid fallthrough between different codecs,
which could easily introduce bugs if people editing the code
aren't careful.

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n2.6
Martin Storsjö 11 years ago
parent
commit
adc214e679
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavformat/rtpenc.c

+ 3
- 0
libavformat/rtpenc.c View File

@@ -255,8 +255,11 @@ static int rtp_write_header(AVFormatContext *s1)
av_log(s1, AV_LOG_ERROR, "Only mono is supported\n");
goto fail;
}
s->num_frames = 0;
goto defaultcase;
case AV_CODEC_ID_AAC:
s->num_frames = 0;
goto defaultcase;
default:
defaultcase:
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {


Loading…
Cancel
Save