Skip to content
Permalink
Browse files Browse the repository at this point in the history
fixed #1706
  • Loading branch information
jeanlf committed Mar 12, 2021
1 parent 2da2f68 commit ebfa346
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/isomedia/isom_read.c
Expand Up @@ -3903,6 +3903,7 @@ u32 gf_isom_guess_specification(GF_ISOFile *file)
case GF_ISOM_SUBTYPE_MPEG4_CRYP:
{
GF_DecoderConfig *dcd = gf_isom_get_decoder_config(file, i+1, 1);
if (!dcd) break;
switch (dcd->streamType) {
case GF_STREAM_VISUAL:
if (dcd->objectTypeIndication==GF_CODECID_MPEG4_PART2) nb_m4v++;
Expand Down
13 changes: 10 additions & 3 deletions src/isomedia/isom_write.c
Expand Up @@ -5352,6 +5352,7 @@ GF_Err gf_isom_set_extraction_slc(GF_ISOFile *the_file, u32 trackNumber, u32 Str
GF_SampleEntryBox *entry;
GF_Err e;
GF_SLConfig **slc;
GF_ESDBox *esds;

trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak) return GF_BAD_PARAM;
Expand All @@ -5362,15 +5363,21 @@ GF_Err gf_isom_set_extraction_slc(GF_ISOFile *the_file, u32 trackNumber, u32 Str
//we must be sure we are not using a remote ESD
switch (entry->type) {
case GF_ISOM_BOX_TYPE_MP4S:
if (((GF_MPEGSampleEntryBox *)entry)->esd->desc->slConfig->predefined != SLPredef_MP4) return GF_BAD_PARAM;
esds = ((GF_MPEGSampleEntryBox *)entry)->esd;
if (!esds || !esds->desc || !esds->desc->slConfig || (esds->desc->slConfig->predefined != SLPredef_MP4))
return GF_ISOM_INVALID_FILE;
slc = & ((GF_MPEGSampleEntryBox *)entry)->slc;
break;
case GF_ISOM_BOX_TYPE_MP4A:
if (((GF_MPEGAudioSampleEntryBox *)entry)->esd->desc->slConfig->predefined != SLPredef_MP4) return GF_BAD_PARAM;
esds = ((GF_MPEGAudioSampleEntryBox *)entry)->esd;
if (!esds || !esds->desc || !esds->desc->slConfig || (esds->desc->slConfig->predefined != SLPredef_MP4))
return GF_ISOM_INVALID_FILE;
slc = & ((GF_MPEGAudioSampleEntryBox *)entry)->slc;
break;
case GF_ISOM_BOX_TYPE_MP4V:
if (((GF_MPEGVisualSampleEntryBox *)entry)->esd->desc->slConfig->predefined != SLPredef_MP4) return GF_BAD_PARAM;
esds = ((GF_MPEGVisualSampleEntryBox *)entry)->esd;
if (!esds || !esds->desc || !esds->desc->slConfig || (esds->desc->slConfig->predefined != SLPredef_MP4))
return GF_ISOM_INVALID_FILE;
slc = & ((GF_MPEGVisualSampleEntryBox *)entry)->slc;
break;
default:
Expand Down
6 changes: 5 additions & 1 deletion src/media_tools/isom_hinter.c
Expand Up @@ -640,7 +640,11 @@ GF_RTPHinter *gf_hinter_track_new(GF_ISOFile *file, u32 TrackNum,
if (hintType==GF_RTP_PAYT_MPEG4) {
tmp->rtp_p->slMap.CodecID = codecid;
/*set this SL for extraction.*/
gf_isom_set_extraction_slc(file, TrackNum, 1, &my_sl);
*e = gf_isom_set_extraction_slc(file, TrackNum, 1, &my_sl);
if (*e) {
gf_hinter_track_del(tmp);
return NULL;
}
}
tmp->bandwidth = bandwidth;

Expand Down

0 comments on commit ebfa346

Please sign in to comment.