From b7522224399f65a0112c4bfbcbbc70264db3bc17 Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Fri, 28 Jul 2006 23:07:03 +0000 Subject: [PATCH] use ternary Originally committed as revision 5841 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/mxf.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libavformat/mxf.c b/libavformat/mxf.c index 2fcd93f14a..1dbe9edb47 100644 --- a/libavformat/mxf.c +++ b/libavformat/mxf.c @@ -197,10 +197,7 @@ static int klv_read_packet(KLVPacket *klv, ByteIOContext *pb) klv->offset = url_ftell(pb); get_buffer(pb, klv->key, 16); klv->length = klv_decode_ber_length(pb); - if (klv->length == -1) - return -1; - else - return 0; + return klv->length == -1 ? -1 : 0; } static int mxf_get_stream_index(AVFormatContext *s, KLVPacket *klv) @@ -227,9 +224,7 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt) if (IS_KLV_KEY(klv.key, mxf_essence_element_key)) { av_get_packet(&s->pb, pkt, klv.length); pkt->stream_index = mxf_get_stream_index(s, &klv); - if (pkt->stream_index == -1) - return -1; - return 0; + return pkt->stream_index == -1 ? -1 : 0; } else url_fskip(&s->pb, klv.length); }