[MPlayer-cvslog] r24933 - trunk/libmpdemux/muxer_mpeg.c

nicodvb subversion at mplayerhq.hu
Fri Nov 2 19:50:42 CET 2007


Author: nicodvb
Date: Fri Nov  2 19:50:41 2007
New Revision: 24933

Log:
moved to fix_parameters() the code that decides if the PSM is needed

Modified:
   trunk/libmpdemux/muxer_mpeg.c

Modified: trunk/libmpdemux/muxer_mpeg.c
==============================================================================
--- trunk/libmpdemux/muxer_mpeg.c	(original)
+++ trunk/libmpdemux/muxer_mpeg.c	Fri Nov  2 19:50:41 2007
@@ -666,7 +666,7 @@ static int write_mpeg_psm(muxer_t *muxer
 
 static int psm_is_late(muxer_priv_t *priv)
 {
-	return (priv->scr >= priv->last_psm_scr + 27000000ULL);
+	return (!priv->data_size || (priv->scr >= priv->last_psm_scr + 27000000ULL));
 }
 
 static int write_mpeg_pes_header(muxer_headers_t *h, uint8_t *pes_id, uint8_t *buff, uint16_t plen, int stuffing_len, int mux_type)
@@ -2227,9 +2227,11 @@ static void fix_parameters(muxer_stream_
 	muxer_headers_t *spriv = stream->priv;
 	muxer_t *muxer = stream->muxer;
 	muxer_priv_t *priv = muxer->priv;
+	uint32_t stream_format;
 
 	if(stream->type == MUXER_TYPE_AUDIO)
 	{
+		stream_format = stream->wf->wFormatTag;
 		spriv->is_ready = 1;
 		if(conf_abuf_size)
 			spriv->max_buffer_size = conf_abuf_size*1024;
@@ -2251,6 +2253,7 @@ static void fix_parameters(muxer_stream_
 	}
 	else	//video
 	{
+		stream_format = stream->bih->biCompression;
 		if(conf_vbuf_size)
 			spriv->max_buffer_size = conf_vbuf_size*1024;
 		else
@@ -2270,6 +2273,12 @@ static void fix_parameters(muxer_stream_
 		else
 			spriv->is_ready = 1;
 	}
+	
+	if(priv->is_genmpeg2)
+	{
+		add_to_psm(priv, spriv->id, stream_format);
+		priv->psm_streams_cnt++;
+	}
 }
 
 
@@ -2371,16 +2380,6 @@ static void mpegfile_write_chunk(muxer_s
 		}
 	}
 
-
-	if(spriv->psm_fixed == 0)
-	{
-		add_to_psm(priv, spriv->id, stream_format);
-		spriv->psm_fixed = 1;
-		priv->psm_streams_cnt++;
-		if((priv->psm_streams_cnt == muxer->num_videos + muxer->num_audios) && priv->use_psm)
-			write_psm_block(muxer, muxer->stream);
-	}
-
 	flush_buffers(muxer, 0);
 }
 



More information about the MPlayer-cvslog mailing list