From 1efd877df1e1f091f4c60ccac1aaba4b70185f16 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 18 Jan 2020 00:10:20 +0100 Subject: [PATCH] ffmpegdec: supplement to fix ogg stream play, disable seek only on ogg format. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6c7b93135d19000c3a07800a5cec6633c073b11f Author: Jacek Jendrzej Date: 2020-01-18 (Sat, 18 Jan 2020) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/audiodec/ffmpegdec.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index 2bad5d34b..b33d8ce8a 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -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);