changeset 1194:f20dada04de5 libavformat

use ternary
author bcoudurier
date Fri, 28 Jul 2006 23:07:03 +0000
parents fcc6f52e2cf1
children a2a8d2c544aa
files mxf.c
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mxf.c	Fri Jul 28 23:03:00 2006 +0000
+++ b/mxf.c	Fri Jul 28 23:07:03 2006 +0000
@@ -197,10 +197,7 @@
     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 @@
         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);
     }