summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-02 18:50:41 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-02 18:50:41 +0000
commitd48b6c6cf500340f0c86f97cf35d20014e2471a8 (patch)
tree4f670a604f9e6727ceded5e1d9a66fbb4c9fc6ac
parent2edf5a5ad33f32bb99c5e849583467660870360a (diff)
downloadmpv-d48b6c6cf500340f0c86f97cf35d20014e2471a8.tar.bz2
mpv-d48b6c6cf500340f0c86f97cf35d20014e2471a8.tar.xz
moved to fix_parameters() the code that decides if the PSM is needed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24933 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libmpdemux/muxer_mpeg.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/libmpdemux/muxer_mpeg.c b/libmpdemux/muxer_mpeg.c
index 3917d4a93c..ecb72f1e67 100644
--- a/libmpdemux/muxer_mpeg.c
+++ b/libmpdemux/muxer_mpeg.c
@@ -666,7 +666,7 @@ static int write_mpeg_psm(muxer_t *muxer, char *buff)
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_t *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_t *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_t *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_stream_t *s,size_t len,unsigned int flags
}
}
-
- 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);
}