]> git.sesse.net Git - vlc/commitdiff
flac packetizer: small factorization when first PTS has not arrived
authorRafaël Carré <funman@videolan.org>
Fri, 15 Nov 2013 20:34:25 +0000 (21:34 +0100)
committerRafaël Carré <funman@videolan.org>
Sat, 16 Nov 2013 00:11:55 +0000 (01:11 +0100)
modules/packetizer/flac.c

index c89cae62e02eb457854151341a5ac1cdf6ed4634..a4ec6af9207455a630469ba7fd65383d5e8adb5d 100644 (file)
@@ -421,11 +421,13 @@ static block_t *Packetize(decoder_t *p_dec, block_t **pp_block)
         return NULL;
     }
 
-    if (!date_Get(&p_sys->end_date) && in->i_pts <= VLC_TS_INVALID) {
-        /* We've just started the stream, wait for the first PTS. */
-        block_Release(in);
-        return NULL;
-    } else if (!date_Get(&p_sys->end_date)) {
+    if (!date_Get(&p_sys->end_date)) {
+        if (in->i_pts <= VLC_TS_INVALID) {
+            /* We've just started the stream, wait for the first PTS. */
+            block_Release(in);
+            return NULL;
+        }
+
         /* The first PTS is as good as anything else. */
         p_sys->i_rate = p_dec->fmt_out.audio.i_rate;
         date_Init(&p_sys->end_date, p_sys->i_rate, 1);