libeplayer3/input: allow access to AVFormatContext

This commit is contained in:
martii
2014-05-29 21:57:38 +02:00
parent 9ac03e1046
commit 56ece5b5ea
6 changed files with 38 additions and 4 deletions

View File

@@ -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)