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>
This commit is contained in:
Martin Storsjö 2014-12-18 12:20:11 +02:00
parent 3bb465245f
commit adc214e679
1 changed files with 3 additions and 0 deletions

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) {