Commit ce1d1aeb authored by Gildas Bazin's avatar Gildas Bazin

* modules/stream_out/transcode.c: reverted previous commit which didn't belong...

* modules/stream_out/transcode.c: reverted previous commit which didn't belong here and was also completely wrong.
parent b88f7e6d
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
*****************************************************************************/ *****************************************************************************/
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h>
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/input.h> #include <vlc/input.h>
...@@ -672,20 +671,9 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt ) ...@@ -672,20 +671,9 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
if( p_sys->f_fps > 0 ) if( p_sys->f_fps > 0 )
{ {
if( id->p_encoder->fmt_out.i_codec == VLC_FOURCC( 'm', 'p', 'g', 'v' ) || id->p_encoder->fmt_out.video.i_frame_rate =
id->p_encoder->fmt_out.i_codec == VLC_FOURCC( 'm', 'p', '1', 'v' ) || p_sys->f_fps * 1001 + 0.5;
id->p_encoder->fmt_out.i_codec == VLC_FOURCC( 'm', 'p', '2', 'v' ) ) id->p_encoder->fmt_out.video.i_frame_rate_base = 1001;
{ /* ffmpeg mpeg1/2 wants integer, 30 not 29.97, for example */
p_sys->f_fps = nearbyint(p_sys->f_fps);
id->p_encoder->fmt_out.video.i_frame_rate = p_sys->f_fps;
id->p_encoder->fmt_out.video.i_frame_rate_base = 1;
}
else
{ /* scale by 1000 so you can get non-integer rates, like 29.97 */
id->p_encoder->fmt_out.video.i_frame_rate =
nearbyint(p_sys->f_fps * 1000) ;
id->p_encoder->fmt_out.video.i_frame_rate_base = 1000;
}
} }
} }
else if( p_fmt->i_cat == SPU_ES && (p_sys->i_scodec || p_sys->psz_senc) ) else if( p_fmt->i_cat == SPU_ES && (p_sys->i_scodec || p_sys->psz_senc) )
...@@ -1376,6 +1364,7 @@ static int transcode_video_encoder_open( sout_stream_t *p_stream, ...@@ -1376,6 +1364,7 @@ static int transcode_video_encoder_open( sout_stream_t *p_stream,
id->p_encoder->fmt_out.video.i_frame_rate; id->p_encoder->fmt_out.video.i_frame_rate;
id->p_encoder->fmt_in.video.i_frame_rate_base = id->p_encoder->fmt_in.video.i_frame_rate_base =
id->p_encoder->fmt_out.video.i_frame_rate_base; id->p_encoder->fmt_out.video.i_frame_rate_base;
date_Init( &id->interpolated_pts, date_Init( &id->interpolated_pts,
id->p_encoder->fmt_out.video.i_frame_rate, id->p_encoder->fmt_out.video.i_frame_rate,
id->p_encoder->fmt_out.video.i_frame_rate_base ); id->p_encoder->fmt_out.video.i_frame_rate_base );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment