Commit c24a40ba authored by Thomas Guillem's avatar Thomas Guillem

demux: always initialize video.i_visible_width/height

parent f7f1c524
......@@ -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 )
{
......
......@@ -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);
......
......@@ -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):
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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 )
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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] );
......
......@@ -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 );
......
......@@ -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;
......
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