mirror of https://github.com/mpv-player/mpv
100% cosmetics: reformatted with tabs and symmetric braces and removed useless braces and trailing tabs
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24930 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
ab990585e5
commit
ddf7776199
|
@ -2227,9 +2227,7 @@ static void fix_parameters(muxer_stream_t *stream)
|
||||||
spriv->max_buffer_size = 16*1024;
|
spriv->max_buffer_size = 16*1024;
|
||||||
}
|
}
|
||||||
else if(stream->wf->wFormatTag == AUDIO_AAC1 || stream->wf->wFormatTag == AUDIO_AAC2)
|
else if(stream->wf->wFormatTag == AUDIO_AAC1 || stream->wf->wFormatTag == AUDIO_AAC2)
|
||||||
{
|
|
||||||
priv->use_psm = 1;
|
priv->use_psm = 1;
|
||||||
}
|
|
||||||
else if(stream->wf->wFormatTag == AUDIO_MP2 || stream->wf->wFormatTag == AUDIO_MP3)
|
else if(stream->wf->wFormatTag == AUDIO_MP2 || stream->wf->wFormatTag == AUDIO_MP3)
|
||||||
spriv->is_ready = 0;
|
spriv->is_ready = 0;
|
||||||
}
|
}
|
||||||
|
@ -2257,7 +2255,8 @@ static void fix_parameters(muxer_stream_t *stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void mpegfile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags, double dts_arg, double pts_arg){
|
static void mpegfile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags, double dts_arg, double pts_arg)
|
||||||
|
{
|
||||||
size_t sz = 0;
|
size_t sz = 0;
|
||||||
uint64_t tmp;
|
uint64_t tmp;
|
||||||
muxer_t *muxer = s->muxer;
|
muxer_t *muxer = s->muxer;
|
||||||
|
@ -2266,12 +2265,11 @@ static void mpegfile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags
|
||||||
float fps;
|
float fps;
|
||||||
uint32_t stream_format, nf;
|
uint32_t stream_format, nf;
|
||||||
|
|
||||||
if(s->buffer == NULL)
|
if(s->buffer == NULL || len == -1)
|
||||||
return;
|
|
||||||
if(len == -1)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (s->type == MUXER_TYPE_VIDEO) { // try to recognize frame type...
|
if (s->type == MUXER_TYPE_VIDEO)
|
||||||
|
{ // try to recognize frame type...
|
||||||
fps = (float) s->h.dwRate/ (float) s->h.dwScale;
|
fps = (float) s->h.dwRate/ (float) s->h.dwScale;
|
||||||
spriv->type = 1;
|
spriv->type = 1;
|
||||||
stream_format = s->bih->biCompression;
|
stream_format = s->bih->biCompression;
|
||||||
|
@ -2287,7 +2285,8 @@ static void mpegfile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags
|
||||||
spriv->is_ready = 1;
|
spriv->is_ready = 1;
|
||||||
if(len)
|
if(len)
|
||||||
sz = parse_mpeg12_video(s, priv, spriv, fps, len);
|
sz = parse_mpeg12_video(s, priv, spriv, fps, len);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
tmp = (uint64_t) (27000000.0f / fps);
|
tmp = (uint64_t) (27000000.0f / fps);
|
||||||
spriv->last_pts += tmp;
|
spriv->last_pts += tmp;
|
||||||
spriv->last_dts += tmp;
|
spriv->last_dts += tmp;
|
||||||
|
@ -2301,7 +2300,8 @@ static void mpegfile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags
|
||||||
priv->use_psm = 1;
|
priv->use_psm = 1;
|
||||||
if(len)
|
if(len)
|
||||||
sz = parse_mpeg4_video(s, priv, spriv, fps, len);
|
sz = parse_mpeg4_video(s, priv, spriv, fps, len);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
tmp = (uint64_t) (27000000.0f / fps);
|
tmp = (uint64_t) (27000000.0f / fps);
|
||||||
spriv->last_pts += tmp;
|
spriv->last_pts += tmp;
|
||||||
spriv->last_dts += tmp;
|
spriv->last_dts += tmp;
|
||||||
|
@ -2309,7 +2309,9 @@ static void mpegfile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags
|
||||||
}
|
}
|
||||||
|
|
||||||
mp_msg(MSGT_MUXER, MSGL_DBG2,"mpegfile_write_chunk, Video codec=%x, len=%u, mpeg12 returned %u\n", stream_format, (uint32_t) len, (uint32_t) sz);
|
mp_msg(MSGT_MUXER, MSGL_DBG2,"mpegfile_write_chunk, Video codec=%x, len=%u, mpeg12 returned %u\n", stream_format, (uint32_t) len, (uint32_t) sz);
|
||||||
} else { // MUXER_TYPE_AUDIO
|
}
|
||||||
|
else
|
||||||
|
{ // MUXER_TYPE_AUDIO
|
||||||
double fake_timer;
|
double fake_timer;
|
||||||
spriv->type = 0;
|
spriv->type = 0;
|
||||||
stream_format = s->wf->wFormatTag;
|
stream_format = s->wf->wFormatTag;
|
||||||
|
@ -2352,7 +2354,8 @@ static void mpegfile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(spriv->psm_fixed == 0) {
|
if(spriv->psm_fixed == 0)
|
||||||
|
{
|
||||||
add_to_psm(priv, spriv->id, stream_format);
|
add_to_psm(priv, spriv->id, stream_format);
|
||||||
spriv->psm_fixed = 1;
|
spriv->psm_fixed = 1;
|
||||||
priv->psm_streams_cnt++;
|
priv->psm_streams_cnt++;
|
||||||
|
@ -2476,7 +2479,8 @@ static void generate_flags(int source, int target)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int muxer_init_muxer_mpeg(muxer_t *muxer){
|
int muxer_init_muxer_mpeg(muxer_t *muxer)
|
||||||
|
{
|
||||||
muxer_priv_t *priv;
|
muxer_priv_t *priv;
|
||||||
priv = (muxer_priv_t *) calloc(1, sizeof(muxer_priv_t));
|
priv = (muxer_priv_t *) calloc(1, sizeof(muxer_priv_t));
|
||||||
if(priv == NULL)
|
if(priv == NULL)
|
||||||
|
@ -2485,7 +2489,8 @@ int muxer_init_muxer_mpeg(muxer_t *muxer){
|
||||||
|
|
||||||
//calloc() already zero-ed all flags, so we assign only the ones we need
|
//calloc() already zero-ed all flags, so we assign only the ones we need
|
||||||
|
|
||||||
if(conf_mux != NULL) {
|
if(conf_mux != NULL)
|
||||||
|
{
|
||||||
if(! strcasecmp(conf_mux, "mpeg1"))
|
if(! strcasecmp(conf_mux, "mpeg1"))
|
||||||
{
|
{
|
||||||
priv->mux = MUX_MPEG1;
|
priv->mux = MUX_MPEG1;
|
||||||
|
|
Loading…
Reference in New Issue