Closed ivan2311 closed 4 years ago
Could you please share the problematic file, so we can see why Mp3Extractor
thinks that it's an MP3 file?
@ojw28 Unfortunately, I can't share that file currently. I'll see if I can share some sample file that has the same issue, so you could investigate Mp3Extractor. In the meantime, can you please help me with my question? Is that safe to do?
I think it's probably safe. @kim-vde might have further thoughts. Note that there's a tracking issue for determining what the best order of extractors really is, which is https://github.com/google/ExoPlayer/issues/6410.
I would be curious to have an example of a FLAC file for which the MP3 sniffing returns true. It would be interesting to understand exactly what happens to potentially prevent it.
I think it is indeed safe to put the FLAC extractor before the MP3 extractor. The only way an MP3 file could be interpreted as a FLAC file is if the first 4 bytes following the ID3 data are "fLaC" in ASCII (in hexadecimal, this corresponds to 0x664C6143), which seems unlikely. This could only happen if the MP3 starts by junk data because a valid MP3 header should start with 11 set bits.
Thanks @ojw28 and @kim-vde for the explanation. As for the .flac file for which the MP3 sniffing returns true, I'll try to share it with you ASAP. In the meantime you can close this issue and I can reopen it when I have some sample file for testing.
Hey @ivan2311. We need more information to resolve this issue but there hasn't been an update in 14 days. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@ivan2311 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.
Could you provide the size of the FLAC file for which the Mp3Extractor was selected, to help me understand what might have happened?
I'm using Flac Extension to play .flac files via ExoPlayer. ExoPlayer has basic setup so
FlacExtractor
should be automatically used when .flac is played. To be exact, I'm usingDefaultExtractorsFactory
which supports 14 different Extractors, includingMp3Extractor
andFlacExtractor
.Almost every .flac file plays ok, except one. For this one .flac file,
Mp3Extractor.sniff
returns true whenExtractorHolder.selectExtractor
is called, soMp3Extractor
gets selected to be used to play this .flac file. Also, if I just removeMp3Extractor
from the list of extractors, or moveFlacExtractor
to be beforeMp3Extractor
in the list of extractors,FlacExtractor
gets selected and that .flac file plays normally.So, my question is: can I just move
FlacExtractor
to be used beforeMp3Extractor
insideExtractorsFactory.createExtractors
? Are there any possible side effects? For example, if I have .mp3 file andFlacExtractor
now gets selected somehow...