[vlc-commits] demux: always initialize video.i_visible_width/height
Thomas Guillem
git at videolan.org
Tue Oct 6 12:23:31 CEST 2015
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Oct 6 12:05:42 2015 +0200| [c24a40bae39fe2e39ea3e8667d044a492791fbee] | committer: Thomas Guillem
demux: always initialize video.i_visible_width/height
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c24a40bae39fe2e39ea3e8667d044a492791fbee
---
modules/demux/asf/asf.c | 2 ++
modules/demux/avformat/demux.c | 2 ++
modules/demux/avi/avi.c | 4 ++++
modules/demux/cdg.c | 2 ++
modules/demux/mkv/matroska_segment_parse.cpp | 4 ++--
modules/demux/mpeg/ts.c | 2 ++
modules/demux/nsv.c | 2 ++
modules/demux/nuv.c | 2 ++
modules/demux/ogg.c | 10 ++++++++++
modules/demux/rawdv.c | 2 ++
modules/demux/real.c | 2 ++
11 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 22fd8e0..fa524d6 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -933,6 +933,8 @@ static int DemuxInit( demux_t *p_demux )
UINT_MAX, uint32_t );
GET_CHECKED( fmt.video.i_height, GetDWLE( p_data + 8 ),
UINT_MAX, uint32_t );
+ fmt.video.i_visible_width = fmt.video.i_width;
+ fmt.video.i_visible_height = fmt.video.i_height;
if( p_esp && p_esp->i_average_time_per_frame > 0 )
{
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 8e227a7..a3d291f 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -403,6 +403,8 @@ int OpenDemux( vlc_object_t *p_this )
fmt.video.i_width = cc->width;
fmt.video.i_height = cc->height;
+ fmt.video.i_visible_width = fmt.video.i_width;
+ fmt.video.i_visible_height = fmt.video.i_height;
get_rotation(&fmt, s);
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 613210d..d77a4a3 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -590,6 +590,8 @@ static int Open( vlc_object_t * p_this )
fmt.video.i_width = p_vids->p_bih->biWidth;
fmt.video.i_height = p_vids->p_bih->biHeight;
+ fmt.video.i_visible_width = fmt.video.i_width;
+ fmt.video.i_visible_height = fmt.video.i_height;
fmt.video.i_bits_per_pixel = p_vids->p_bih->biBitCount;
fmt.video.i_frame_rate = tk->i_rate;
fmt.video.i_frame_rate_base = tk->i_scale;
@@ -668,6 +670,8 @@ static int Open( vlc_object_t * p_this )
es_format_Init( &fmt, VIDEO_ES, p_strh->i_handler );
fmt.video.i_width = p_avih->i_width;
fmt.video.i_height = p_avih->i_height;
+ fmt.video.i_visible_width = fmt.video.i_width;
+ fmt.video.i_visible_height = fmt.video.i_height;
break;
case( AVIFOURCC_mids):
diff --git a/modules/demux/cdg.c b/modules/demux/cdg.c
index ebb18ee..212a4f3 100644
--- a/modules/demux/cdg.c
+++ b/modules/demux/cdg.c
@@ -98,6 +98,8 @@ static int Open( vlc_object_t * p_this )
es_format_Init( &p_sys->fmt, VIDEO_ES, VLC_CODEC_CDG );
p_sys->fmt.video.i_width = 300-2*6;
p_sys->fmt.video.i_height = 216-2*12 ;
+ p_sys->fmt.video.i_visible_width = p_sys->fmt.video.i_width;
+ p_sys->fmt.video.i_visible_height = p_sys->fmt.video.i_height;
p_sys->p_es = es_out_Add( p_demux->out, &p_sys->fmt );
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 185fecc6..c0ab042 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -645,10 +645,10 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
tk->fmt.video.i_sar_num = i_display_width * tk->fmt.video.i_height;
tk->fmt.video.i_sar_den = i_display_height * tk->fmt.video.i_width;
}
+ tk->fmt.video.i_visible_width = tk->fmt.video.i_width;
+ tk->fmt.video.i_visible_height = tk->fmt.video.i_height;
if( i_crop_left || i_crop_right || i_crop_top || i_crop_bottom )
{
- tk->fmt.video.i_visible_width = tk->fmt.video.i_width;
- tk->fmt.video.i_visible_height = tk->fmt.video.i_height;
tk->fmt.video.i_x_offset = i_crop_left;
tk->fmt.video.i_y_offset = i_crop_top;
tk->fmt.video.i_visible_width -= i_crop_left + i_crop_right;
diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index 233035f..770c19b 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -4739,6 +4739,8 @@ static void PMTSetupEs0xA0( demux_t *p_demux, ts_pes_es_t *p_es,
p_dr->p_data[2], p_dr->p_data[3] );
p_fmt->video.i_width = GetWBE( &p_dr->p_data[4] );
p_fmt->video.i_height = GetWBE( &p_dr->p_data[6] );
+ p_fmt->video.i_visible_width = p_fmt->video.i_width;
+ p_fmt->video.i_visible_height = p_fmt->video.i_height;
p_fmt->i_extra = GetWBE( &p_dr->p_data[8] );
if( p_fmt->i_extra > 0 )
diff --git a/modules/demux/nsv.c b/modules/demux/nsv.c
index b9b3585..32c60d4 100644
--- a/modules/demux/nsv.c
+++ b/modules/demux/nsv.c
@@ -503,6 +503,8 @@ static int ReadNSVs( demux_t *p_demux )
es_format_Init( &p_sys->fmt_video, VIDEO_ES, fcc );
p_sys->fmt_video.video.i_width = GetWLE( &header[12] );
p_sys->fmt_video.video.i_height = GetWLE( &header[14] );
+ p_sys->fmt_video.video.i_visible_width = p_sys->fmt_video.video.i_width;
+ p_sys->fmt_video.video.i_visible_height = p_sys->fmt_video.video.i_height;
if( p_sys->p_video )
{
es_out_Del( p_demux->out, p_sys->p_video );
diff --git a/modules/demux/nuv.c b/modules/demux/nuv.c
index be4008d..9aaffd7 100644
--- a/modules/demux/nuv.c
+++ b/modules/demux/nuv.c
@@ -301,6 +301,8 @@ static int Open( vlc_object_t * p_this )
es_format_Init( &fmt, VIDEO_ES, p_sys->exh.i_video_fcc );
fmt.video.i_width = p_sys->hdr.i_width;
fmt.video.i_height = p_sys->hdr.i_height;
+ fmt.video.i_visible_width = fmt.video.i_width;
+ fmt.video.i_visible_height = fmt.video.i_height;
fmt.i_extra = p_sys->i_extra_f;
fmt.p_extra = p_sys->p_extra_f;
fmt.video.i_sar_num = p_sys->hdr.d_aspect * fmt.video.i_height;
diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 905a637..2498f74 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1768,6 +1768,10 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
GetDWLE((oggpacket.packet+176));
p_stream->fmt.video.i_height =
GetDWLE((oggpacket.packet+180));
+ p_stream->fmt.video.i_visible_width =
+ p_stream->fmt.video.i_width;
+ p_stream->fmt.video.i_visible_height =
+ p_stream->fmt.video.i_height;
msg_Dbg( p_demux,
"fps: %f, width:%i; height:%i, bitcount:%i",
@@ -1890,6 +1894,10 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
p_stream->fmt.video.i_bits_per_pixel = st->bits_per_sample;
p_stream->fmt.video.i_width = st->sh.video.width;
p_stream->fmt.video.i_height = st->sh.video.height;
+ p_stream->fmt.video.i_visible_width =
+ p_stream->fmt.video.i_width;
+ p_stream->fmt.video.i_visible_height =
+ p_stream->fmt.video.i_height;
msg_Dbg( p_demux,
"fps: %f, width:%i; height:%i, bitcount:%i",
@@ -2848,6 +2856,8 @@ static bool Ogg_ReadVP8Header( demux_t *p_demux, logical_stream_t *p_stream,
p_stream->i_granule_shift = 32;
p_stream->fmt.video.i_width = GetWBE( &p_oggpacket->packet[8] );
p_stream->fmt.video.i_height = GetWBE( &p_oggpacket->packet[10] );
+ p_stream->fmt.video.i_visible_width = p_stream->fmt.video.i_width;
+ p_stream->fmt.video.i_visible_height = p_stream->fmt.video.i_height;
p_stream->fmt.video.i_sar_num = GetDWBE( &p_oggpacket->packet[12 - 1] ) & 0x0FFF;
p_stream->fmt.video.i_sar_den = GetDWBE( &p_oggpacket->packet[15 - 1] ) & 0x0FFF;
p_stream->fmt.video.i_frame_rate = GetDWBE( &p_oggpacket->packet[18] );
diff --git a/modules/demux/rawdv.c b/modules/demux/rawdv.c
index 77dc254..2ef54c2 100644
--- a/modules/demux/rawdv.c
+++ b/modules/demux/rawdv.c
@@ -215,6 +215,8 @@ static int Open( vlc_object_t * p_this )
es_format_Init( &p_sys->fmt_video, VIDEO_ES, VLC_CODEC_DV );
p_sys->fmt_video.video.i_width = 720;
p_sys->fmt_video.video.i_height= dv_header.dsf ? 576 : 480;;
+ p_sys->fmt_video.video.i_visible_width = p_sys->fmt_video.video.i_width;
+ p_sys->fmt_video.video.i_visible_height = p_sys->fmt_video.video.i_height;
p_sys->p_es_video = es_out_Add( p_demux->out, &p_sys->fmt_video );
diff --git a/modules/demux/real.c b/modules/demux/real.c
index 0fa8cd7..80a151d 100644
--- a/modules/demux/real.c
+++ b/modules/demux/real.c
@@ -1375,6 +1375,8 @@ static int CodecVideoParse( demux_t *p_demux, int i_tk_id, const uint8_t *p_data
VLC_FOURCC( p_data[8], p_data[9], p_data[10], p_data[11] ) );
fmt.video.i_width = GetWBE( &p_data[12] );
fmt.video.i_height= GetWBE( &p_data[14] );
+ fmt.video.i_visible_width = fmt.video.i_width;
+ fmt.video.i_visible_height = fmt.video.i_height;
fmt.video.i_frame_rate = (GetWBE( &p_data[22] ) << 16) | GetWBE( &p_data[24] );
fmt.video.i_frame_rate_base = 1 << 16;
More information about the vlc-commits
mailing list