forked from wang-bin/QtAV
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closed by avformat_close_input. results in crash in 3.1
- Loading branch information
Showing
2 changed files
with
16 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/****************************************************************************** | ||
QtAV: Media play library based on Qt and FFmpeg | ||
Copyright (C) 2014-2015 Wang Bin <[email protected]> | ||
QtAV: Multimedia framework based on Qt and FFmpeg | ||
Copyright (C) 2012-2016 Wang Bin <[email protected]> | ||
* This file is part of QtAV | ||
* This file is part of QtAV (from 2014) | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
|
@@ -70,7 +70,12 @@ class Q_AV_EXPORT MediaIO : public QObject | |
|
||
virtual ~MediaIO(); | ||
virtual QString name() const = 0; | ||
virtual void setUrl(const QString& url); | ||
/*! | ||
* \brief setUrl | ||
* onUrlChange() will be called if url is different. onUrlChange() will close the old url and open the new url if it's not empty | ||
* \param url | ||
*/ | ||
void setUrl(const QString& url = QString()); | ||
QString url() const; | ||
/*! | ||
* \brief setAccessMode | ||
|
@@ -104,7 +109,7 @@ class Q_AV_EXPORT MediaIO : public QObject | |
* \param from SEEK_SET, SEEK_CUR and SEEK_END from stdio.h | ||
* \return true if success | ||
*/ | ||
virtual bool seek(qint64 offset, int from) = 0; | ||
virtual bool seek(qint64 offset, int from = SEEK_SET) = 0; | ||
/*! | ||
* \brief position | ||
* MUST implement this. Used in seek | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/****************************************************************************** | ||
QtAV: Media play library based on Qt and FFmpeg | ||
Copyright (C) 2014-2015 Wang Bin <[email protected]> | ||
QtAV: Multimedia framework based on Qt and FFmpeg | ||
Copyright (C) 2012-2016 Wang Bin <[email protected]> | ||
Initial QAVIOContext.cpp code is from Stefan Ladage <[email protected]> | ||
* This file is part of QtAV | ||
* This file is part of QtAV (from 2014) | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
|
@@ -193,10 +193,8 @@ void MediaIO::release() | |
DPTR_D(MediaIO); | ||
if (!d.ctx) | ||
return; | ||
d.ctx->opaque = 0; //in avio_close() opaque is URLContext* and will call ffurl_close() | ||
//d.ctx->buffer = 0; //already released by ffio_rewind_with_probe_data; may be another context was freed | ||
avio_close(d.ctx); //avio_closep defined since ffmpeg1.1 | ||
d.ctx = 0; | ||
// avio_close is called by avformat_close_input. here we only allocate but no open | ||
av_freep(&d.ctx->buffer); | ||
av_freep(&d.ctx); | ||
} | ||
|
||
} //namespace QtAV |