ffmpeg | branch: master | Martin Storsjö <mar...@martin.st> | Thu Dec 18 12:20:11 2014 +0200| [adc214e6797750285a5e62634b8521db521162ad] | committer: Martin Storsjö
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ö <mar...@martin.st> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=adc214e6797750285a5e62634b8521db521162ad --- libavformat/rtpenc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index dafe3a0..e5dc805 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) { _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog