Commit ec166301 authored by Sam Hocevar's avatar Sam Hocevar

* ./codec/dv/dv.c: moved this single file to its parent directory; removed

    GetFirstPES in favour of input_ExtractPES/input_DeletePES calls.
parent 3e017c26
...@@ -17,7 +17,6 @@ EXTRA_DIST = \ ...@@ -17,7 +17,6 @@ EXTRA_DIST = \
codec/a52old/downmix/Modules.am \ codec/a52old/downmix/Modules.am \
codec/a52old/imdct/Modules.am \ codec/a52old/imdct/Modules.am \
codec/cinepak/Modules.am \ codec/cinepak/Modules.am \
codec/dv/Modules.am \
codec/faad/Modules.am \ codec/faad/Modules.am \
codec/ffmpeg/Modules.am \ codec/ffmpeg/Modules.am \
codec/ffmpeg/postprocessing/Modules.am \ codec/ffmpeg/postprocessing/Modules.am \
......
...@@ -2,3 +2,5 @@ SOURCES_a52 = modules/codec/a52.c ...@@ -2,3 +2,5 @@ SOURCES_a52 = modules/codec/a52.c
SOURCES_lpcm = modules/codec/lpcm.c SOURCES_lpcm = modules/codec/lpcm.c
SOURCES_araw = modules/codec/araw.c SOURCES_araw = modules/codec/araw.c
SOURCES_vorbis = modules/codec/vorbis.c SOURCES_vorbis = modules/codec/vorbis.c
SOURCES_dv = modules/codec/dv.c
#SOURCES_xvid = modules/codec/xvid.c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dv.c: a decoder for DV video * dv.c: a decoder for DV video
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: dv.c,v 1.4 2002/11/02 17:31:37 sigmunau Exp $ * $Id: dv.c,v 1.1 2002/11/05 14:52:28 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -40,7 +40,6 @@ static int RunDecoder ( decoder_fifo_t * ); ...@@ -40,7 +40,6 @@ static int RunDecoder ( decoder_fifo_t * );
static int OpenDecoder ( vlc_object_t * ); static int OpenDecoder ( vlc_object_t * );
static u32 GetFourCC ( dv_sample_t ); static u32 GetFourCC ( dv_sample_t );
static pes_packet_t *GetFirstPES( decoder_fifo_t * );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
...@@ -75,6 +74,7 @@ static int OpenDecoder ( vlc_object_t *p_this ) ...@@ -75,6 +74,7 @@ static int OpenDecoder ( vlc_object_t *p_this )
static int RunDecoder ( decoder_fifo_t *p_fifo ) static int RunDecoder ( decoder_fifo_t *p_fifo )
{ {
u8 *p_buffer; u8 *p_buffer;
pes_packet_t *p_pes = NULL;
int i_data = 120000; int i_data = 120000;
int i_aspect; int i_aspect;
...@@ -199,14 +199,17 @@ static int RunDecoder ( decoder_fifo_t *p_fifo ) ...@@ -199,14 +199,17 @@ static int RunDecoder ( decoder_fifo_t *p_fifo )
while( !p_fifo->b_die && !p_fifo->b_error ) while( !p_fifo->b_die && !p_fifo->b_error )
{ {
mtime_t i_pts = 0; mtime_t i_pts = 0;
pes_packet_t *p_pes;
GetChunk( &bit_stream, p_buffer + i_data, GetChunk( &bit_stream, p_buffer + i_data,
p_decoder->frame_size - i_data ); p_decoder->frame_size - i_data );
i_data = p_decoder->frame_size; i_data = p_decoder->frame_size;
p_pes = GetFirstPES( p_fifo ); if( p_pes )
{
input_DeletePES( p_fifo->p_packets_mgt, p_pes );
}
input_ExtractPES( p_fifo, &p_pes );
if( p_pes ) if( p_pes )
{ {
/* Don't trust the sucker */ /* Don't trust the sucker */
...@@ -268,6 +271,11 @@ static int RunDecoder ( decoder_fifo_t *p_fifo ) ...@@ -268,6 +271,11 @@ static int RunDecoder ( decoder_fifo_t *p_fifo )
} }
} }
if( p_pes )
{
input_DeletePES( p_fifo->p_packets_mgt, p_pes );
}
free( p_buffer ); free( p_buffer );
CloseBitstream( &bit_stream ); CloseBitstream( &bit_stream );
...@@ -291,25 +299,3 @@ static u32 GetFourCC( dv_sample_t x ) ...@@ -291,25 +299,3 @@ static u32 GetFourCC( dv_sample_t x )
} }
} }
static pes_packet_t *GetFirstPES( decoder_fifo_t *p_fifo )
{
pes_packet_t *p_pes;
vlc_mutex_lock( &p_fifo->data_lock );
/* if fifo is empty wait */
while( !p_fifo->p_first )
{
if( p_fifo->b_die )
{
vlc_mutex_unlock( &p_fifo->data_lock );
return NULL;
}
vlc_cond_wait( &p_fifo->data_wait, &p_fifo->data_lock );
}
p_pes = p_fifo->p_first;
vlc_mutex_unlock( &p_fifo->data_lock );
return p_pes;
}
SOURCES_dv = modules/codec/dv/dv.c
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