[vlc-commits] packetizer: mpegaudio: fully rebuild dts/pts with dvrms

Francois Cartegnie git at videolan.org
Mon Feb 20 19:12:16 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Feb 20 19:11:36 2017 +0100| [830274e9afcb513f13f9963921f29e77c6b5e72c] | committer: Francois Cartegnie

packetizer: mpegaudio: fully rebuild dts/pts with dvrms

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

 modules/demux/asf/asf.c        | 12 ++++++++++--
 modules/packetizer/mpegaudio.c | 10 +++++++++-
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 8923299..5e50ffc 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -996,7 +996,6 @@ static int DemuxInit( demux_t *p_demux )
             {
                 /* DVR-MS special ASF */
                 fmt.i_codec = VLC_CODEC_MPGV;
-                fmt.i_original_fourcc = VLC_FOURCC( 'D','V','R',' ');
             }
 
             if( p_sp->i_type_specific_data_length > 11 +
@@ -1128,7 +1127,16 @@ static int DemuxInit( demux_t *p_demux )
             es_format_Init( &fmt, UNKNOWN_ES, 0 );
         }
 
-        fmt.b_packetized = !b_dvrms;
+        if( b_dvrms )
+        {
+            fmt.i_original_fourcc = VLC_FOURCC( 'D','V','R',' ');
+            fmt.b_packetized = false;
+        }
+        else
+        {
+            fmt.b_packetized = true;
+        }
+
         tk->i_cat = tk->info.i_cat = fmt.i_cat;
         if( fmt.i_cat != UNKNOWN_ES )
         {
diff --git a/modules/packetizer/mpegaudio.c b/modules/packetizer/mpegaudio.c
index 391cb99..a4e6888 100644
--- a/modules/packetizer/mpegaudio.c
+++ b/modules/packetizer/mpegaudio.c
@@ -347,7 +347,15 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             if( p_sys->i_pts > VLC_TS_INVALID &&
                 p_sys->i_pts != date_Get( &p_sys->end_date ) )
             {
-                date_Set( &p_sys->end_date, p_sys->i_pts );
+                if( p_dec->fmt_in.i_original_fourcc == VLC_FOURCC( 'D','V','R',' ') )
+                {
+                    if( date_Get( &p_sys->end_date ) == VLC_TS_INVALID )
+                        date_Set( &p_sys->end_date, p_sys->i_pts );
+                }
+                else if ( p_sys->i_pts != date_Get( &p_sys->end_date ) )
+                {
+                    date_Set( &p_sys->end_date, p_sys->i_pts );
+                }
             }
             p_sys->i_state = STATE_HEADER;
 



More information about the vlc-commits mailing list