Skip to content

Commit

Permalink
[demuxers/MpegTS] Fix probing for ADTS/AAC when frames do not fit int…
Browse files Browse the repository at this point in the history
…o a single PES packet
  • Loading branch information
eumagga0x2a committed Aug 28, 2019
1 parent f6b3cd0 commit 4f01e2d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions avidemux_plugins/ADM_demuxers/MpegTS/ADM_tsAudioProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,7 @@ uint64_t pts,dts,startAt;
uint8_t *eData=NULL;

trackInfo->wav.encoding=WAV_AAC;


again:
if(!retries)
{
ADM_error("Cannot get info from audio\n");
return false;
}

if(false==p->getNextPES(&pes))
{
ADM_warning("Cannot get pes packet for AAC track\n");
Expand Down Expand Up @@ -154,10 +147,17 @@ uint64_t pts,dts,startAt;
ADM_adts2aac adts;
trackInfo->mux=ADM_TS_MUX_ADTS;
int dummySize=0;
if(ADM_adts2aac::ADTS_OK!=adts.convert2(size,ptr,&dummySize,NULL)) // We dont need the output hence the null
while(ADM_adts2aac::ADTS_OK!=adts.convert2(size,ptr,&dummySize,NULL)) // We dont need the output hence the null
{
ADM_info("ADTS no sync\n");
goto again;
if(!retries || false==p->getNextPES(&pes))
{
ADM_warning("Cannot get pes packet for AAC track\n");
return false;
}
ptr=pes.payload+pes.offset;
size=pes.payloadSize-pes.offset;
retries--;
}
adts.getExtraData(&eLen,&eData);
if( eLen!=2)
Expand Down

0 comments on commit 4f01e2d

Please sign in to comment.