aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpenc.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2014-12-18 12:20:11 +0200
committerMartin Storsjö <martin@martin.st>2014-12-18 23:11:37 +0200
commitadc214e6797750285a5e62634b8521db521162ad (patch)
treefe07b3ec07fa25b43fb42fdcf1a1fcf1d679c229 /libavformat/rtpenc.c
parent3bb465245fed6069512e6821000391beae8a6066 (diff)
downloadffmpeg-adc214e6797750285a5e62634b8521db521162ad.tar.gz
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>
Diffstat (limited to 'libavformat/rtpenc.c')
-rw-r--r--libavformat/rtpenc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index dafe3a0a70..e5dc8057f9 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -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) {