Skip to content

Commit

Permalink
Better fix, i hope...
Browse files Browse the repository at this point in the history
Signed-off-by: jpsdr <jpsdr.psx@free.fr>
  • Loading branch information
jpsdr committed Sep 23, 2024
1 parent 60133d6 commit 37450d7
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions input/audio/lsmash.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,42 +207,34 @@ static void lsmash_close( hnd_t handle )
static audio_packet_t *get_next_au( hnd_t handle )
{
lsmash_source_t *h = handle;

lsmash_sample_t *sample=calloc( 1, sizeof( lsmash_sample_t ) );
if( !sample )
return NULL;

audio_packet_t *out = calloc( 1, sizeof( audio_packet_t ) );

if( !out )
{
free(sample);
return NULL;
}
return NULL;
out->info = h->info;
out->channels = h->info.channels;
out->samplecount = h->info.framelen;
out->dts = h->last_dts;

*sample={0};
lsmash_sample_alloc( sample, h->summary->max_au_length );
lsmash_sample_t sample = {0};
lsmash_sample_t *psample = &sample;
lsmash_sample_alloc( &sample, h->summary->max_au_length );

int ret = lsmash_importer_get_access_unit( h->importer, 1, &sample );
int ret = lsmash_importer_get_access_unit( h->importer, 1, &psample );

out->size = sample->length;
out->data = sample->data;
out->size = sample.length;
out->data = sample.data;

if( ret || !out->size )
{
if( !out->size )
h->info.last_delta = lsmash_importer_get_last_delta( h->importer, 1 );
free(sample);
x264_af_free_packet( out );
return NULL;
}

h->last_dts += h->info.framelen;
h->frame_count++;
free(sample);

return out;
}
Expand Down

0 comments on commit 37450d7

Please sign in to comment.