Module: libav
Branch: master
Commit: adc214e6797750285a5e62634b8521db521162ad

Author:    Martin Storsjö <[email protected]>
Committer: Martin Storsjö <[email protected]>
Date:      Thu Dec 18 12:20:11 2014 +0200

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ö <[email protected]>

---

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

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to