Commit 95ce042e authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/libmpeg2.c: hack for demuxers which only have DTS timestamps.
parent 18af7f2b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libmpeg2.c: mpeg2 video decoder module making use of libmpeg2. * libmpeg2.c: mpeg2 video decoder module making use of libmpeg2.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: libmpeg2.c,v 1.37 2003/12/07 12:11:13 gbazin Exp $ * $Id: libmpeg2.c,v 1.38 2003/12/10 23:27:34 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -320,6 +320,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -320,6 +320,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
case STATE_PICTURE: case STATE_PICTURE:
{ {
uint8_t *buf[3]; uint8_t *buf[3];
mtime_t i_pts;
buf[0] = buf[1] = buf[2] = NULL; buf[0] = buf[1] = buf[2] = NULL;
if ( p_sys->b_after_sequence_header && if ( p_sys->b_after_sequence_header &&
...@@ -336,13 +337,27 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -336,13 +337,27 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
} }
p_sys->b_after_sequence_header = 0; p_sys->b_after_sequence_header = 0;
vout_SynchroNewPicture( p_sys->p_synchro, i_pts = p_sys->p_info->current_picture->flags & PIC_FLAG_PTS ?
p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE,
p_sys->p_info->current_picture->nb_fields,
(p_sys->p_info->current_picture->flags & PIC_FLAG_PTS) ?
( ( p_sys->p_info->current_picture->pts == ( ( p_sys->p_info->current_picture->pts ==
(uint32_t)p_sys->i_current_pts ) ? (uint32_t)p_sys->i_current_pts ) ?
p_sys->i_current_pts : p_sys->i_previous_pts ) : 0, p_sys->i_current_pts : p_sys->i_previous_pts ) : 0;
/* Hack to handle demuxers which only have DTS timestamps */
if( !i_pts && !p_block->i_pts && p_block->i_dts > 0 )
{
if( p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ||
(p_sys->p_info->current_picture->flags &
PIC_MASK_CODING_TYPE) == PIC_FLAG_CODING_TYPE_B )
{
i_pts = p_block->i_dts;
}
}
p_block->i_pts = p_block->i_dts = 0;
/* End hack */
vout_SynchroNewPicture( p_sys->p_synchro,
p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE,
p_sys->p_info->current_picture->nb_fields, i_pts,
0, p_sys->i_current_rate ); 0, p_sys->i_current_rate );
if ( !(p_sys->b_slice_i if ( !(p_sys->b_slice_i
......
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