mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libeplayer3/input: allow access to AVFormatContext
This commit is contained in:
@@ -532,6 +532,7 @@ bool Input::Stop()
|
||||
usleep(100000);
|
||||
|
||||
if (avfc) {
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(mutex);
|
||||
for (unsigned int i = 0; i < avfc->nb_streams; i++)
|
||||
avcodec_close(avfc->streams[i]->codec);
|
||||
avformat_close_input(&avfc);
|
||||
@@ -542,6 +543,21 @@ bool Input::Stop()
|
||||
return true;
|
||||
}
|
||||
|
||||
AVFormatContext *Input::GetAVFormatContext()
|
||||
{
|
||||
mutex.lock();
|
||||
if (avfc)
|
||||
return avfc;
|
||||
mutex.unlock();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Input::ReleaseAVFormatContext()
|
||||
{
|
||||
if (avfc)
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
bool Input::Seek(int64_t avts, bool absolute)
|
||||
{
|
||||
if (absolute)
|
||||
|
Reference in New Issue
Block a user