From 646f7beb332351fbc634fc828a64844a9132477c Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Thu, 27 Nov 2003 19:39:53 +0000 Subject: [PATCH] copy: set pts to dts if pts <= 0. (Needed to make div3 streaming working again) ts: use one stream_id for mpeg video (and one for mpeg audio). --- modules/mux/mpeg/ts.c | 14 +++----------- modules/packetizer/copy.c | 11 ++++++++++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c index 63cd097939..ce3c81d5f3 100644 --- a/modules/mux/mpeg/ts.c +++ b/modules/mux/mpeg/ts.c @@ -2,7 +2,7 @@ * ts.c: MPEG-II TS Muxer ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: ts.c,v 1.39 2003/11/22 20:25:01 fenrir Exp $ + * $Id: ts.c,v 1.40 2003/11/27 19:39:53 fenrir Exp $ * * Authors: Laurent Aimar * Eric Petit @@ -185,9 +185,6 @@ struct sout_mux_sys_t int i_pcr_pid; sout_input_t *p_pcr_input; - int i_stream_id_mpga; - int i_stream_id_mpgv; - int i_audio_bound; int i_video_bound; @@ -269,9 +266,6 @@ static int Open( vlc_object_t *p_this ) srand( (uint32_t)mdate() ); - p_sys->i_stream_id_mpga = 0xc0; - p_sys->i_stream_id_mpgv = 0xe0; - p_sys->i_audio_bound = 0; p_sys->i_video_bound = 0; @@ -430,8 +424,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) case VLC_FOURCC( 'm', 'p','g', 'v' ): /* TODO: do we need to check MPEG-I/II ? */ p_stream->i_stream_type = 0x02; - p_stream->i_stream_id = p_sys->i_stream_id_mpgv; - p_sys->i_stream_id_mpgv++; + p_stream->i_stream_id = 0xe0; break; case VLC_FOURCC( 'm', 'p','4', 'v' ): p_stream->i_stream_type = 0x10; @@ -467,8 +460,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) { case VLC_FOURCC( 'm', 'p','g', 'a' ): p_stream->i_stream_type = p_input->p_fmt->audio.i_rate >= 32000 ? 0x03 : 0x04; - p_stream->i_stream_id = p_sys->i_stream_id_mpga; - p_sys->i_stream_id_mpga++; + p_stream->i_stream_id = 0xc0; break; case VLC_FOURCC( 'a', '5','2', ' ' ): p_stream->i_stream_type = 0x81; diff --git a/modules/packetizer/copy.c b/modules/packetizer/copy.c index ad4cc18ff0..057e970c79 100644 --- a/modules/packetizer/copy.c +++ b/modules/packetizer/copy.c @@ -2,7 +2,7 @@ * copy.c ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: copy.c,v 1.20 2003/11/22 20:17:14 fenrir Exp $ + * $Id: copy.c,v 1.21 2003/11/27 19:39:53 fenrir Exp $ * * Authors: Laurent Aimar * Eric Petit @@ -261,6 +261,15 @@ static block_t *Packetize ( decoder_t *p_dec, block_t **pp_block ) p_block = *pp_block; *pp_block = NULL; + if( p_block->i_pts <= 0 ) + { + p_block->i_pts = p_block->i_dts; + } + else if( p_block->i_dts <= 0 ) + { + p_block->i_dts = p_block->i_pts; + } + if( p_block->i_pts <= 0 ) { msg_Dbg( p_dec, "need pts > 0" ); -- GitLab