Author Topic: BASS HLS for Android: Missing metadata for the first downloaded segment  (Read 375 times)

hunar15

  • Posts: 3
Hi,

I have a setup where I'm trying to read metadata off an HLS stream. The stream is such that metadata is only present in the EXTRAINF tag of the first chunk of a particular media, say a song and not its subsequent chunks. The stream also plays the media from the start upon request, meaning that the first segment will always be accompanied by a tag.

I'm facing an issue where I cannot see the EXTRAINF of the first segment being downloaded. I've taken precautions to ensure that the sync is set up well before the stream is played, but it seems that the HLS segment sync is not being triggered when the first segment is being downloaded. Its being triggered for the following segments as expected.

If it helps, I'm logging the currently playing segment i.e
Code: [Select]
BASS.BASS_StreamGetFilePosition(channel, BASSHLS.BASS_FILEPOS_HLS_SEGMENT) in the sync and it seems that the first log sometime indicates segment 2. I find this odd, because I would have expected the currently playing segment to be -1 or some invalid value at the time of downloading the first segment. This is what leads me to believe that the sync is not triggered when the first segment starts downloading.

I can provide more information if needed. Any help would be greatly appreciated.

Thanks!

Ian @ un4seen

  • Administrator
  • Posts: 21358
The first segment begins downloading during stream creation, to initialize the appropriate decoder. So there will indeed be no sync triggered for that, as it began before the sync was set. You can get the BASS_TAG_HLS_EXTINF tag immediately after creation for its info.