1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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

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