Commit de81c25d authored by Laurent Aimar's avatar Laurent Aimar

* all: removed block_t->b_discontinuity,b_frame_* and added i_flags

 field and a few BLOCK_FLAG_*.
parent e7523028
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlc_block.h: Data blocks management functions * vlc_block.h: Data blocks management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: vlc_block.h,v 1.5 2003/12/24 09:46:08 gbazin Exp $ * $Id: vlc_block.h,v 1.6 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -29,17 +29,27 @@ ...@@ -29,17 +29,27 @@
*/ */
typedef struct block_sys_t block_sys_t; typedef struct block_sys_t block_sys_t;
/* BLOCK_FLAG_DISCONTINUITY: the content doesn't follow the last block, or is probably broken */
#define BLOCK_FLAG_DISCONTINUITY 0x0001
/* BLOCK_FLAG_TYPE_I: Intra frame */
#define BLOCK_FLAG_TYPE_I 0x0002
/* BLOCK_FLAG_TYPE_P: inter frame with backward reference only */
#define BLOCK_FLAG_TYPE_P 0x0004
/* BLOCK_FLAG_TYPE_B: inter frame with backward and forward reference */
#define BLOCK_FLAG_TYPE_B 0x0008
/* BLOCK_FLAG_TYPE_PB: for inter frame when you don't know the real type */
#define BLOCK_FLAG_TYPE_PB 0x0010
struct block_t struct block_t
{ {
block_t *p_next; block_t *p_next;
vlc_bool_t b_frame_display; uint32_t i_flags;
vlc_bool_t b_frame_start;
mtime_t i_pts; mtime_t i_pts;
mtime_t i_dts; mtime_t i_dts;
mtime_t i_length; mtime_t i_length;
vlc_bool_t b_discontinuity; /* only temporary */
int i_rate; int i_rate;
int i_buffer; int i_buffer;
...@@ -108,7 +118,6 @@ VLC_EXPORT( void, block_FifoRelease, ( block_fifo_t * ) ); ...@@ -108,7 +118,6 @@ VLC_EXPORT( void, block_FifoRelease, ( block_fifo_t * ) );
VLC_EXPORT( void, block_FifoEmpty, ( block_fifo_t * ) ); VLC_EXPORT( void, block_FifoEmpty, ( block_fifo_t * ) );
VLC_EXPORT( int, block_FifoPut, ( block_fifo_t *, block_t * ) ); VLC_EXPORT( int, block_FifoPut, ( block_fifo_t *, block_t * ) );
VLC_EXPORT( block_t *, block_FifoGet, ( block_fifo_t * ) ); VLC_EXPORT( block_t *, block_FifoGet, ( block_fifo_t * ) );
VLC_EXPORT( block_t *, block_FifoGetFrame, ( block_fifo_t * ) );
VLC_EXPORT( block_t *, block_FifoShow, ( block_fifo_t * ) ); VLC_EXPORT( block_t *, block_FifoShow, ( block_fifo_t * ) );
#endif /* VLC_BLOCK_H */ #endif /* VLC_BLOCK_H */
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* a52.c: parse A/52 audio sync info and packetize the stream * a52.c: parse A/52 audio sync info and packetize the stream
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2002 VideoLAN * Copyright (C) 2001-2002 VideoLAN
* $Id: a52.c,v 1.33 2004/02/13 21:48:32 gbazin Exp $ * $Id: a52.c,v 1.34 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Stphane Borel <stef@via.ecp.fr> * Authors: Stphane Borel <stef@via.ecp.fr>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -171,7 +171,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -171,7 +171,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
} }
if( (*pp_block)->b_discontinuity ) if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dts.c: parse DTS audio sync info and packetize the stream * dts.c: parse DTS audio sync info and packetize the stream
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: dts.c,v 1.17 2004/02/07 00:56:44 gbazin Exp $ * $Id: dts.c,v 1.18 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -172,7 +172,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -172,7 +172,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
} }
if( (*pp_block)->b_discontinuity ) if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* decoder.c: AAC decoder using libfaad2 * decoder.c: AAC decoder using libfaad2
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2003 VideoLAN * Copyright (C) 2001, 2003 VideoLAN
* $Id: faad.c,v 1.13 2004/02/19 17:42:43 jpsaman Exp $ * $Id: faad.c,v 1.14 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -176,7 +176,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -176,7 +176,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
if( p_block->b_discontinuity ) if( p_block->i_flags&BLOCK_FLAG_DISCONTINUITY )
{ {
block_Release( p_block ); block_Release( p_block );
return NULL; return NULL;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio.c: audio decoder using ffmpeg library * audio.c: audio decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2003 VideoLAN * Copyright (C) 1999-2003 VideoLAN
* $Id: audio.c,v 1.27 2003/11/27 12:32:03 fenrir Exp $ * $Id: audio.c,v 1.28 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -157,7 +157,8 @@ aout_buffer_t *E_( DecodeAudio )( decoder_t *p_dec, block_t **pp_block ) ...@@ -157,7 +157,8 @@ aout_buffer_t *E_( DecodeAudio )( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
} }
if( p_block->i_buffer <= 0 || p_block->b_discontinuity ) if( p_block->i_buffer <= 0 ||
( p_block->i_flags&BLOCK_FLAG_DISCONTINUITY ) )
{ {
block_Release( p_block ); block_Release( p_block );
return NULL; return NULL;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video.c: video decoder using the ffmpeg library * video.c: video decoder using the ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: video.c,v 1.66 2004/02/08 22:37:37 gbazin Exp $ * $Id: video.c,v 1.67 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -373,7 +373,7 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block ) ...@@ -373,7 +373,7 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
if( p_block->b_discontinuity ) if( p_block->i_flags&BLOCK_FLAG_DISCONTINUITY )
{ {
p_sys->i_buffer = 0; p_sys->i_buffer = 0;
p_sys->i_pts = 0; /* To make sure we recover properly */ p_sys->i_pts = 0; /* To make sure we recover properly */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* flac.c: flac decoder/packetizer/encoder module making use of libflac * flac.c: flac decoder/packetizer/encoder module making use of libflac
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: flac.c,v 1.8 2004/02/07 00:16:34 gbazin Exp $ * $Id: flac.c,v 1.9 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no> * Sigmund Augdal <sigmunau@idi.ntnu.no>
...@@ -258,7 +258,7 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -258,7 +258,7 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
} }
if( (*pp_block)->b_discontinuity ) if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
} }
......
...@@ -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.42 2004/01/16 09:39:57 sam Exp $ * $Id: libmpeg2.c,v 1.43 2004/02/25 17:48:52 fenrir 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>
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <vlc/vout.h> #include <vlc/vout.h>
#include <vlc/decoder.h> #include <vlc/decoder.h>
#define PIC_FLAG_PTS
#include <mpeg2dec/mpeg2.h> #include <mpeg2dec/mpeg2.h>
#include "vout_synchro.h" #include "vout_synchro.h"
...@@ -210,7 +211,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -210,7 +211,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
} }
if( p_block->b_discontinuity && p_sys->p_synchro && if( (p_block->i_flags&BLOCK_FLAG_DISCONTINUITY) &&
p_sys->p_synchro &&
p_sys->p_info->sequence && p_sys->p_info->sequence &&
p_sys->p_info->sequence->width != (unsigned)-1 ) p_sys->p_info->sequence->width != (unsigned)-1 )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpeg_audio.c: parse MPEG audio sync info and packetize the stream * mpeg_audio.c: parse MPEG audio sync info and packetize the stream
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: mpeg_audio.c,v 1.25 2004/01/25 18:20:12 bigben Exp $ * $Id: mpeg_audio.c,v 1.26 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org> * Eric Petit <titer@videolan.org>
...@@ -189,7 +189,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -189,7 +189,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
} }
if( (*pp_block)->b_discontinuity ) if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* a52.c : raw A/52 stream input module for vlc * a52.c : raw A/52 stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: a52.c,v 1.5 2004/02/17 13:13:32 gbazin Exp $ * $Id: a52.c,v 1.6 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -293,7 +293,6 @@ static int Demux( input_thread_t * p_input ) ...@@ -293,7 +293,6 @@ static int Demux( input_thread_t * p_input )
p_input->stream.p_selected_program, p_input->stream.p_selected_program,
p_block_out->i_pts * 9 / 100 ); p_block_out->i_pts * 9 / 100 );
p_block_in->b_discontinuity = 0;
p_block_out->i_dts = p_block_out->i_pts = p_block_out->i_dts = p_block_out->i_pts =
input_ClockGetTS( p_input, p_input->stream.p_selected_program, input_ClockGetTS( p_input, p_input->stream.p_selected_program,
p_block_out->i_pts * 9 / 100 ); p_block_out->i_pts * 9 / 100 );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dts.c : raw DTS stream input module for vlc * dts.c : raw DTS stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: dts.c,v 1.9 2004/02/24 19:23:11 gbazin Exp $ * $Id: dts.c,v 1.10 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -291,7 +291,6 @@ static int Demux( input_thread_t * p_input ) ...@@ -291,7 +291,6 @@ static int Demux( input_thread_t * p_input )
p_input->stream.p_selected_program, p_input->stream.p_selected_program,
p_block_out->i_pts * 9 / 100 ); p_block_out->i_pts * 9 / 100 );
p_block_in->b_discontinuity = 0;
p_block_out->i_dts = p_block_out->i_pts = p_block_out->i_dts = p_block_out->i_pts =
input_ClockGetTS( p_input, p_input->stream.p_selected_program, input_ClockGetTS( p_input, p_input->stream.p_selected_program,
p_block_out->i_pts * 9 / 100 ); p_block_out->i_pts * 9 / 100 );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* flac.c : FLAC demux module for vlc * flac.c : FLAC demux module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: flac.c,v 1.10 2004/01/25 20:05:28 hartman Exp $ * $Id: flac.c,v 1.11 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -222,7 +222,6 @@ static int Demux( input_thread_t * p_input ) ...@@ -222,7 +222,6 @@ static int Demux( input_thread_t * p_input )
p_input->stream.p_selected_program, p_input->stream.p_selected_program,
p_block_out->i_pts * 9 / 100 ); p_block_out->i_pts * 9 / 100 );
p_block_in->b_discontinuity = 0;
p_block_out->i_dts = p_block_out->i_pts = p_block_out->i_dts = p_block_out->i_pts =
input_ClockGetTS( p_input, p_input->stream.p_selected_program, input_ClockGetTS( p_input, p_input->stream.p_selected_program,
p_block_out->i_pts * 9 / 100 ); p_block_out->i_pts * 9 / 100 );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* block.c: Data blocks management functions * block.c: Data blocks management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2003-2004 VideoLAN * Copyright (C) 2003-2004 VideoLAN
* $Id: block.c,v 1.6 2004/01/06 12:02:06 zorglub Exp $ * $Id: block.c,v 1.7 2004/02/25 17:48:52 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@videolan.org> * Authors: Laurent Aimar <fenrir@videolan.org>
* *
...@@ -70,11 +70,9 @@ static block_t *__BlockDupContent( block_t *p_block ) ...@@ -70,11 +70,9 @@ static block_t *__BlockDupContent( block_t *p_block )
p_dup = block_New( p_block->p_manager, p_block->i_buffer ); p_dup = block_New( p_block->p_manager, p_block->i_buffer );
memcpy( p_dup->p_buffer, p_block->p_buffer, p_block->i_buffer ); memcpy( p_dup->p_buffer, p_block->p_buffer, p_block->i_buffer );
p_dup->b_frame_display = p_block->b_frame_display; p_dup->i_flags = p_block->i_flags;
p_dup->b_frame_start = p_block->b_frame_start;
p_dup->i_pts = p_block->i_pts; p_dup->i_pts = p_block->i_pts;
p_dup->i_dts = p_block->i_dts; p_dup->i_dts = p_block->i_dts;
p_dup->b_discontinuity = p_block->b_discontinuity;
return p_dup; return p_dup;
} }
...@@ -192,14 +190,11 @@ block_t *block_NewEmpty( void ) ...@@ -192,14 +190,11 @@ block_t *block_NewEmpty( void )
memset( p_block, 0, sizeof( block_t ) ); memset( p_block, 0, sizeof( block_t ) );
p_block->p_next = NULL; p_block->p_next = NULL;
p_block->b_frame_display= VLC_TRUE; p_block->i_flags = 0;
p_block->b_frame_start = VLC_FALSE;
p_block->i_pts = 0; p_block->i_pts = 0;
p_block->i_dts = 0; p_block->i_dts = 0;
p_block->i_length = 0; p_block->i_length = 0;
p_block->b_discontinuity= VLC_FALSE;
p_block->i_buffer = 0; p_block->i_buffer = 0;
p_block->p_buffer = NULL; p_block->p_buffer = NULL;
...@@ -320,8 +315,7 @@ block_t *block_ChainGather( block_t *p_list ) ...@@ -320,8 +315,7 @@ block_t *block_ChainGather( block_t *p_list )
g = block_New( p_list->p_manager, i_total ); g = block_New( p_list->p_manager, i_total );
block_ChainExtract( p_list, g->p_buffer, g->i_buffer ); block_ChainExtract( p_list, g->p_buffer, g->i_buffer );
g->b_frame_display = p_list->b_frame_display; g->i_flags = p_list->i_flags;
g->b_frame_start = p_list->b_frame_start;
g->i_pts = p_list->i_pts; g->i_pts = p_list->i_pts;
g->i_dts = p_list->i_dts; g->i_dts = p_list->i_dts;
...@@ -445,20 +439,3 @@ block_t *block_FifoShow( block_fifo_t *p_fifo ) ...@@ -445,20 +439,3 @@ block_t *block_FifoShow( block_fifo_t *p_fifo )
} }
block_t *block_FifoGetFrame( block_fifo_t *p_fifo )
{
block_t *b = NULL;
for( ;; )
{
block_t *p_next;
block_ChainAppend( &b, block_FifoGet( p_fifo ) );
p_next = block_FifoShow( p_fifo );
if( p_next == NULL || p_next->b_frame_start )
{
break;
}
}
return b;
}
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