avformat/mov: Simplify get_stream_info_time()
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 7 Dec 2018 20:38:25 +0000 (21:38 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 19 Dec 2018 19:09:03 +0000 (20:09 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mov.c

index fb95fd2..ec839ed 100644 (file)
@@ -1234,16 +1234,12 @@ static int search_frag_moof_offset(MOVFragmentIndex *frag_index, int64_t offset)
 
 static int64_t get_stream_info_time(MOVFragmentStreamInfo * frag_stream_info)
 {
-
-    if (frag_stream_info) {
-        if (frag_stream_info->sidx_pts != AV_NOPTS_VALUE)
-            return frag_stream_info->sidx_pts;
-        if (frag_stream_info->first_tfra_pts != AV_NOPTS_VALUE)
-            return frag_stream_info->first_tfra_pts;
-        if (frag_stream_info->tfdt_dts != AV_NOPTS_VALUE)
-            return frag_stream_info->tfdt_dts;
-    }
-    return AV_NOPTS_VALUE;
+    av_assert0(frag_stream_info);
+    if (frag_stream_info->sidx_pts != AV_NOPTS_VALUE)
+        return frag_stream_info->sidx_pts;
+    if (frag_stream_info->first_tfra_pts != AV_NOPTS_VALUE)
+        return frag_stream_info->first_tfra_pts;
+    return frag_stream_info->tfdt_dts;
 }
 
 static int64_t get_frag_time(MOVFragmentIndex *frag_index,