mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
ffmpegdec: supplement to fix ogg stream play, disable seek only on ogg format.
This commit is contained in:
@@ -121,7 +121,7 @@ static int64_t seek_packet(void *opaque, int64_t offset, int whence)
|
||||
return ((CFfmpegDec *) opaque)->Seek(offset, whence);
|
||||
}
|
||||
|
||||
bool CFfmpegDec::Init(void *_in, const CFile::FileType /* ft */)
|
||||
bool CFfmpegDec::Init(void *_in, const CFile::FileType ft)
|
||||
{
|
||||
title = "";
|
||||
artist = "";
|
||||
@@ -151,12 +151,15 @@ bool CFfmpegDec::Init(void *_in, const CFile::FileType /* ft */)
|
||||
av_freep(&buffer);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool use_seek = true;
|
||||
if (is_stream){
|
||||
avc->probesize = 128 * 1024;
|
||||
av_opt_set_int(avc, "analyzeduration", 1000000, 0);
|
||||
if(ft == CFile::FILE_OGG)
|
||||
use_seek = false;
|
||||
}
|
||||
avioc = avio_alloc_context (buffer, buffer_size, 0, this, read_packet, NULL, !is_stream ? seek_packet:NULL);
|
||||
|
||||
avioc = avio_alloc_context (buffer, buffer_size, 0, this, read_packet, NULL, use_seek ? seek_packet:NULL);
|
||||
if (!avioc) {
|
||||
av_freep(&buffer);
|
||||
avformat_free_context(avc);
|
||||
|
Reference in New Issue
Block a user