[vlc-commits] packetizer: mpegaudio: forward discontinuities

Francois Cartegnie git at videolan.org
Wed Oct 26 19:07:02 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct 25 11:05:39 2016 +0200| [1c55bfd92114610ab71a8290364abbd5d3fe188e] | committer: Francois Cartegnie

packetizer: mpegaudio: forward discontinuities

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

 modules/packetizer/mpeg4audio.c | 2 ++
 modules/packetizer/mpegaudio.c  | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/modules/packetizer/mpeg4audio.c b/modules/packetizer/mpeg4audio.c
index 6391cd7..24ee58b 100644
--- a/modules/packetizer/mpeg4audio.c
+++ b/modules/packetizer/mpeg4audio.c
@@ -330,6 +330,8 @@ static block_t *PacketizeRawBlock(decoder_t *p_dec, block_t **pp_block)
         return NULL;
     } else if (p_block->i_pts > VLC_TS_INVALID &&
              p_block->i_pts != date_Get(&p_sys->end_date)) {
+        if(date_Get(&p_sys->end_date) > 0)
+            p_sys->b_discontuinity = true;
         date_Set(&p_sys->end_date, p_block->i_pts);
     }
 
diff --git a/modules/packetizer/mpegaudio.c b/modules/packetizer/mpegaudio.c
index 761098d..ff8c10a 100644
--- a/modules/packetizer/mpegaudio.c
+++ b/modules/packetizer/mpegaudio.c
@@ -558,6 +558,12 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             if( p_sys->i_pts == p_sys->bytestream.p_block->i_pts )
                 p_sys->i_pts = p_sys->bytestream.p_block->i_pts = VLC_TS_INVALID;
 
+            if( p_sys->b_discontinuity )
+            {
+                p_out_buffer->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+                p_sys->b_discontinuity = false;
+            }
+
             /* So p_block doesn't get re-added several times */
             p_block = block_BytestreamPop( &p_sys->bytestream );
             if (pp_block)



More information about the vlc-commits mailing list