Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

lsmashinput: Break loop when feeding null packet and not output.

  • Loading branch information...
commit 3fb11230591dac997d7e8f09c678f282f7b70f8f 1 parent e32def6
@VFR-maniac authored
Showing with 5 additions and 8 deletions.
  1. +2 −5 AviUtl/libav_input.c
  2. +3 −3 AviUtl/libavsmash_input.c
View
7 AviUtl/libav_input.c
@@ -1441,16 +1441,13 @@ static int read_audio( lsmash_handler_t *h, int start, int wanted_length, void *
goto audio_out;
}
else if( pkt->size <= 0 )
- {
- if( get_sample( hp->audio_format, hp->audio_index, hp->audio_input_buffer, pkt ) )
- goto audio_out;
- }
+ get_sample( hp->audio_format, hp->audio_index, hp->audio_input_buffer, pkt );
int output_audio = 0;
do
{
int decode_complete;
int wasted_data_length = avcodec_decode_audio4( hp->audio_ctx, &hp->audio_frame_buffer, &decode_complete, pkt );
- if( wasted_data_length < 0 )
+ if( wasted_data_length < 0 || (wasted_data_length == 0 && !decode_complete) )
break;
if( pkt->data )
{
View
6 AviUtl/libavsmash_input.c
@@ -856,14 +856,14 @@ static int read_audio( lsmash_handler_t *h, int start, int wanted_length, void *
else
goto audio_out;
}
- else if( pkt->size <= 0 && get_sample( hp->root, hp->audio_track_ID, frame_number, hp->audio_input_buffer, pkt ) )
- goto audio_out;
+ else if( pkt->size <= 0 )
+ get_sample( hp->root, hp->audio_track_ID, frame_number, hp->audio_input_buffer, pkt );
int output_audio = 0;
do
{
int decode_complete;
int wasted_data_length = avcodec_decode_audio4( hp->audio_ctx, &hp->audio_frame_buffer, &decode_complete, pkt );
- if( wasted_data_length < 0 )
+ if( wasted_data_length < 0 || (wasted_data_length == 0 && !decode_complete) )
break;
if( pkt->data )
{
Please sign in to comment.
Something went wrong with that request. Please try again.