Commit 291d3226 authored by Gildas Bazin's avatar Gildas Bazin

* modules/demux/rawdv.c: fixes for when the video and audio sub-streams are not both selected.
parent c74a2b3c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* rawdv.c : raw dv input module for vlc * rawdv.c : raw dv input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: rawdv.c,v 1.5 2003/03/30 18:14:37 gbazin Exp $ * $Id: rawdv.c,v 1.6 2003/04/27 14:56:47 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -381,6 +381,8 @@ static int Demux( input_thread_t * p_input ) ...@@ -381,6 +381,8 @@ static int Demux( input_thread_t * p_input )
} }
/* Build video PES packet */ /* Build video PES packet */
if( p_rawdv->p_video_es->p_decoder_fifo )
{
p_pes = input_NewPES( p_input->p_method_data ); p_pes = input_NewPES( p_input->p_method_data );
if( p_pes == NULL ) if( p_pes == NULL )
{ {
...@@ -396,8 +398,11 @@ static int Demux( input_thread_t * p_input ) ...@@ -396,8 +398,11 @@ static int Demux( input_thread_t * p_input )
p_pes->i_pts = p_pes->i_pts =
input_ClockGetTS( p_input, p_input->stream.p_selected_program, input_ClockGetTS( p_input, p_input->stream.p_selected_program,
p_rawdv->i_pcr ); p_rawdv->i_pcr );
}
/* Do the same for audio */ /* Do the same for audio */
if( p_rawdv->p_audio_es->p_decoder_fifo )
{
p_audio_pes = input_NewPES( p_input->p_method_data ); p_audio_pes = input_NewPES( p_input->p_method_data );
if( p_pes == NULL ) if( p_pes == NULL )
{ {
...@@ -406,20 +411,34 @@ static int Demux( input_thread_t * p_input ) ...@@ -406,20 +411,34 @@ static int Demux( input_thread_t * p_input )
return -1; return -1;
} }
p_audio_pes->i_rate = p_input->stream.control.i_rate; p_audio_pes->i_rate = p_input->stream.control.i_rate;
if( p_rawdv->p_video_es->p_decoder_fifo )
p_audio_pes->p_first = p_audio_pes->p_last = p_audio_pes->p_first = p_audio_pes->p_last =
input_ShareBuffer( p_input->p_method_data, p_data->p_buffer ); input_ShareBuffer( p_input->p_method_data, p_data->p_buffer );
else
p_audio_pes->p_first = p_audio_pes->p_last = p_data;
p_audio_pes->p_first->p_next = p_data->p_next; p_audio_pes->p_first->p_next = p_data->p_next;
p_audio_pes->p_first->p_payload_start = p_data->p_payload_start; p_audio_pes->p_first->p_payload_start = p_data->p_payload_start;
p_audio_pes->p_first->p_payload_end = p_data->p_payload_end; p_audio_pes->p_first->p_payload_end = p_data->p_payload_end;
p_audio_pes->i_pes_size = i_read; p_audio_pes->i_pes_size = i_read;
p_audio_pes->i_nb_data = 1; p_audio_pes->i_nb_data = 1;
p_audio_pes->i_pts = p_pes->i_pts; p_audio_pes->i_pts =
input_ClockGetTS( p_input, p_input->stream.p_selected_program,
p_rawdv->i_pcr );
}
/* Decode PES packets */ /* Decode PES packets if stream is selected */
if( p_rawdv->p_video_es->p_decoder_fifo )
input_DecodePES( p_rawdv->p_video_es->p_decoder_fifo, p_pes ); input_DecodePES( p_rawdv->p_video_es->p_decoder_fifo, p_pes );
if( p_rawdv->p_audio_es->p_decoder_fifo )
input_DecodePES( p_rawdv->p_audio_es->p_decoder_fifo, p_audio_pes ); input_DecodePES( p_rawdv->p_audio_es->p_decoder_fifo, p_audio_pes );
p_rawdv->i_pcr += ( 90000 / p_rawdv->f_rate ); p_rawdv->i_pcr += ( 90000 / p_rawdv->f_rate );
if( !p_rawdv->p_video_es->p_decoder_fifo &&
!p_rawdv->p_audio_es->p_decoder_fifo )
input_DeletePacket( p_input->p_method_data, p_data );
return 1; return 1;
} }
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