X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Fschroedinger.c;h=fceae03c05831d93d3468b1ca42fab86d7e08a88;hb=12ade3e3bc975d5426ba4af155b7372c31093b31;hp=bc08984c7f44266fab868c8bfe16aa08591adde2;hpb=2151d6fe01a3b730b6d241b561ce18f5cc424faf;p=vlc diff --git a/modules/codec/schroedinger.c b/modules/codec/schroedinger.c index bc08984c7f..fceae03c05 100644 --- a/modules/codec/schroedinger.c +++ b/modules/codec/schroedinger.c @@ -35,7 +35,6 @@ #include #include #include -#include #include @@ -112,7 +111,7 @@ static int OpenDecoder( vlc_object_t *p_this ) p_dec->p_sys = p_sys; p_sys->p_schro = p_schro; p_sys->p_format = NULL; - p_sys->i_lastpts = -1; + p_sys->i_lastpts = VLC_TS_INVALID; p_sys->i_frame_pts_delta = 0; /* Set output properties */ @@ -131,7 +130,6 @@ static int OpenDecoder( vlc_object_t *p_this ) static void SetVideoFormat( decoder_t *p_dec ) { decoder_sys_t *p_sys = p_dec->p_sys; - double f_aspect; p_sys->p_format = schro_decoder_get_video_format(p_sys->p_schro); if( p_sys->p_format == NULL ) return; @@ -159,11 +157,8 @@ static void SetVideoFormat( decoder_t *p_dec ) p_dec->fmt_out.video.i_height = p_sys->p_format->height; /* aspect_ratio_[numerator|denominator] describes the pixel aspect ratio */ - f_aspect = (double) - ( p_sys->p_format->aspect_ratio_numerator * p_sys->p_format->width ) / - ( p_sys->p_format->aspect_ratio_denominator * p_sys->p_format->height); - - p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * f_aspect; + p_dec->fmt_out.video.i_sar_num = p_sys->p_format->aspect_ratio_numerator; + p_dec->fmt_out.video.i_sar_den = p_sys->p_format->aspect_ratio_denominator; p_dec->fmt_out.video.i_frame_rate = p_sys->p_format->frame_rate_numerator; @@ -300,7 +295,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY ) { schro_decoder_reset( p_sys->p_schro ); - p_sys->i_lastpts = -1; + p_sys->i_lastpts = VLC_TS_INVALID; block_Release( p_block ); *pp_block = NULL; return NULL; @@ -310,7 +305,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) p_schrobuffer = schro_buffer_new_with_data( p_block->p_buffer, p_block->i_buffer ); p_schrobuffer->free = SchroBufferFree; p_schrobuffer->priv = p_block; - if( p_block->i_pts != VLC_TS_INVALID ) { + if( p_block->i_pts > VLC_TS_INVALID ) { mtime_t *p_pts = malloc( sizeof(*p_pts) ); if( p_pts ) { *p_pts = p_block->i_pts; @@ -373,7 +368,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) p_pic->date = *(mtime_t*) p_tag->value; schro_tag_free( p_tag ); } - else if( p_sys->i_lastpts >= 0 ) + else if( p_sys->i_lastpts > VLC_TS_INVALID ) { /* NB, this shouldn't happen since the packetizer does a * very thorough job of inventing timestamps. The