[vlc-commits] transcode: use width/ height if visible dimension is not specified by decoder/filter
Rafaël Carré
git at videolan.org
Mon Sep 9 16:43:00 CEST 2013
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Sep 9 16:20:18 2013 +0200| [e0bf2bb3721214b2d663ed1b7203f2621fd62a7c] | committer: Rafaël Carré
transcode: use width/height if visible dimension is not specified by decoder/filter
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e0bf2bb3721214b2d663ed1b7203f2621fd62a7c
---
modules/stream_out/transcode/video.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 2b59a64..bbfe95d 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -193,6 +193,16 @@ int transcode_video_new( sout_stream_t *p_stream, sout_stream_id_t *id )
? id->p_encoder->fmt_out.video.i_height
: id->p_decoder->fmt_in.video.i_height
? id->p_decoder->fmt_in.video.i_height : 16;
+ id->p_encoder->fmt_in.video.i_visible_width =
+ id->p_encoder->fmt_out.video.i_visible_width
+ ? id->p_encoder->fmt_out.video.i_visible_width
+ : id->p_decoder->fmt_in.video.i_visible_width
+ ? id->p_decoder->fmt_in.video.i_visible_width : 16;
+ id->p_encoder->fmt_in.video.i_visible_height =
+ id->p_encoder->fmt_out.video.i_visible_height
+ ? id->p_encoder->fmt_out.video.i_visible_height
+ : id->p_decoder->fmt_in.video.i_visible_height
+ ? id->p_decoder->fmt_in.video.i_visible_height : 16;
id->p_encoder->fmt_in.video.i_frame_rate = ENC_FRAMERATE;
id->p_encoder->fmt_in.video.i_frame_rate_base = ENC_FRAMERATE_BASE;
@@ -347,6 +357,12 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream,
int i_src_visible_width = p_fmt_out->video.i_visible_width;
int i_src_visible_height = p_fmt_out->video.i_visible_height;
+ if (i_src_visible_width == 0)
+ i_src_visible_width = p_fmt_out->video.i_width;
+ if (i_src_visible_height == 0)
+ i_src_visible_height = p_fmt_out->video.i_height;
+
+
/* with/height scaling */
float f_scale_width = 1;
float f_scale_height = 1;
More information about the vlc-commits
mailing list