Commit 4a3274fb authored by Marian Durkovic's avatar Marian Durkovic

modifications for RTP reordering:

 * for RTP, prebuffering is done within RTP access
 * reordering now working within this buffer
 * solves synchro problems since packet rate is preserved 
parent 60acd31a
...@@ -103,6 +103,8 @@ struct access_t ...@@ -103,6 +103,8 @@ struct access_t
int i_title; /* idem, start from 0 (could be menu) */ int i_title; /* idem, start from 0 (could be menu) */
int i_seekpoint;/* idem, start from 0 */ int i_seekpoint;/* idem, start from 0 */
vlc_bool_t b_prebuffered; /* Read only for input */
} info; } info;
access_sys_t *p_sys; access_sys_t *p_sys;
}; };
......
...@@ -77,6 +77,7 @@ typedef struct block_sys_t block_sys_t; ...@@ -77,6 +77,7 @@ typedef struct block_sys_t block_sys_t;
struct block_t struct block_t
{ {
block_t *p_next; block_t *p_next;
block_t *p_prev;
uint32_t i_flags; uint32_t i_flags;
...@@ -87,6 +88,8 @@ struct block_t ...@@ -87,6 +88,8 @@ struct block_t
int i_samples; /* Used for audio */ int i_samples; /* Used for audio */
int i_rate; int i_rate;
uint16_t i_seqno; /* Used for RTP */
int i_buffer; int i_buffer;
uint8_t *p_buffer; uint8_t *p_buffer;
......
This diff is collapsed.
...@@ -72,6 +72,7 @@ static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access, ...@@ -72,6 +72,7 @@ static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access,
p_access->info.i_size = 0; p_access->info.i_size = 0;
p_access->info.i_pos = 0; p_access->info.i_pos = 0;
p_access->info.b_eof = VLC_FALSE; p_access->info.b_eof = VLC_FALSE;
p_access->info.b_prebuffered = VLC_FALSE;
p_access->info.i_title = 0; p_access->info.i_title = 0;
p_access->info.i_seekpoint = 0; p_access->info.i_seekpoint = 0;
......
...@@ -566,6 +566,7 @@ static int AStreamControl( stream_t *s, int i_query, va_list args ) ...@@ -566,6 +566,7 @@ static int AStreamControl( stream_t *s, int i_query, va_list args )
static void AStreamPrebufferBlock( stream_t *s ) static void AStreamPrebufferBlock( stream_t *s )
{ {
stream_sys_t *p_sys = s->p_sys; stream_sys_t *p_sys = s->p_sys;
access_t *p_access = p_sys->p_access;
int64_t i_first = 0; int64_t i_first = 0;
int64_t i_start; int64_t i_start;
...@@ -606,12 +607,6 @@ static void AStreamPrebufferBlock( stream_t *s ) ...@@ -606,12 +607,6 @@ static void AStreamPrebufferBlock( stream_t *s )
continue; continue;
} }
if( i_first == 0 )
{
i_first = mdate();
msg_Dbg( s, "received first data for our buffer");
}
while( b ) while( b )
{ {
/* Append the block */ /* Append the block */
...@@ -622,6 +617,21 @@ static void AStreamPrebufferBlock( stream_t *s ) ...@@ -622,6 +617,21 @@ static void AStreamPrebufferBlock( stream_t *s )
p_sys->stat.i_read_count++; p_sys->stat.i_read_count++;
b = b->p_next; b = b->p_next;
} }
if( p_access->info.b_prebuffered )
{
/* Access has already prebufferred - update stats and exit */
p_sys->stat.i_bytes = p_sys->block.i_size;
p_sys->stat.i_read_time = mdate() - i_start;
break;
}
if( i_first == 0 )
{
i_first = mdate();
msg_Dbg( s, "received first data for our buffer");
}
} }
p_sys->block.p_current = p_sys->block.p_first; p_sys->block.p_current = p_sys->block.p_first;
......
...@@ -64,11 +64,13 @@ block_t *__block_New( vlc_object_t *p_obj, int i_size ) ...@@ -64,11 +64,13 @@ block_t *__block_New( vlc_object_t *p_obj, int i_size )
/* Fill all fields */ /* Fill all fields */
p_block->p_next = NULL; p_block->p_next = NULL;
p_block->p_prev = NULL;
p_block->i_flags = 0; p_block->i_flags = 0;
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->i_rate = 0; p_block->i_rate = 0;
p_block->i_seqno = 0;
p_block->i_buffer = i_size; p_block->i_buffer = i_size;
p_block->p_buffer = p_block->p_buffer =
&p_sys->p_allocated_buffer[BLOCK_PADDING_SIZE + &p_sys->p_allocated_buffer[BLOCK_PADDING_SIZE +
......
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