[vlc-commits] flac packetizer: small factorization when first PTS has not arrived

Rafaël Carré git at videolan.org
Sat Nov 16 01:12:01 CET 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Fri Nov 15 21:34:25 2013 +0100| [a799a89f2a54e64f28f66f0d9af79d8acefde090] | committer: Rafaël Carré

flac packetizer: small factorization when first PTS has not arrived

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a799a89f2a54e64f28f66f0d9af79d8acefde090
---

 modules/packetizer/flac.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/packetizer/flac.c b/modules/packetizer/flac.c
index c89cae6..a4ec6af 100644
--- a/modules/packetizer/flac.c
+++ b/modules/packetizer/flac.c
@@ -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);



More information about the vlc-commits mailing list