[FFmpeg-cvslog] avformat/utils: Slightly un-clutter code in determinable_frame_size() by using a switch
Michael Niedermayer
git at videolan.org
Tue Jun 6 19:32:42 EEST 2017
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Jun 4 02:25:46 2017 +0200| [850cbd496f8d583467cf6194dec3f6264efc0521] | committer: Michael Niedermayer
avformat/utils: Slightly un-clutter code in determinable_frame_size() by using a switch
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=850cbd496f8d583467cf6194dec3f6264efc0521
---
libavformat/utils.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index c97d248db0..c641377385 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -894,12 +894,13 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
static int determinable_frame_size(AVCodecContext *avctx)
{
- if (/*avctx->codec_id == AV_CODEC_ID_AAC ||*/
- avctx->codec_id == AV_CODEC_ID_MP1 ||
- avctx->codec_id == AV_CODEC_ID_MP2 ||
- avctx->codec_id == AV_CODEC_ID_MP3/* ||
- avctx->codec_id == AV_CODEC_ID_CELT*/)
+ switch(avctx->codec_id) {
+ case AV_CODEC_ID_MP1:
+ case AV_CODEC_ID_MP2:
+ case AV_CODEC_ID_MP3:
return 1;
+ }
+
return 0;
}
More information about the ffmpeg-cvslog
mailing list