Exoplayer: Support seeking for FLAC streams without SEEKTABLE.

Created on 8 Sep 2016  路  11Comments  路  Source: google/ExoPlayer

I want to know is flac seekable or not? Each time I seek it from the demo-ext, the progress returns to zero immediately.

here is the sample I tried:

sampleAdapter.add(new Header("FALC"));
    sampleAdapter.add(new Sample("a flac sample",
            "http://www.zaishuxia.com/music/files/pingfanzhilu.flac",
            Util.TYPE_OTHER));

question

All 11 comments

@erdemguven - Please take a look. Thanks!

Hi nezen, currently flac files are seekable only if they include a SEEKTABLE metadata block. In this case your flac doesn't have one.
You can check flac files to see if they have a seektable:
metaflac --list sample.flac | grep SEEKTABLE
To add 100 seek points to a file
flac -S 100x sample.flac -o new_sample.flac
Please see flac documentation for other options.

erdemguven, thanks! I checked the flac with metaflac and there is no SEEKTABLE. But when I try to seek it with MediaPlayer.seekTo() , it worked. So what's going on?

MediaPlayer uses libflac for seeking which just do a search in flac file for the correct position if there isn't any seektable. Currently ExoPlayer doesn't do that for flac files.

Hi, is such a feature on the roadmap for the exoplayer?

@burix, sorry, it isn't.

And why not? I receive a lot of user complaints about media the user cannot seek.

As above, seeking in FLAC already works if there's a SEEKTABLE metadata block. We may support seeking (by searching) in other FLAC files at some point, but it's a long way down our list of priorities right now. If you're able to contribute a pull request that adds support, please feel free to do so.

Okay it sounded as if the feature was not wanted for some reason. I barely understand all this audio stuff but would really welcome if someone tackles this :)

This is finished and will be pushed to the dev branch within the next few days.

Fixed in 972304f16b0f5aba21439785b4c9e2b831e364f6.

Was this page helpful?
0 / 5 - 0 ratings