Skip to content

Commit

Permalink
cuda: clear the frame queue on flush
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Mar 28, 2014
1 parent 53ce6b8 commit 1f7c0fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/QtAV/AVDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Q_AV_EXPORT AVDecoder
virtual bool open();
virtual bool close();
bool isOpen() const;
void flush();
virtual void flush();
void setCodecContext(AVCodecContext* codecCtx); //protected
AVCodecContext* codecContext() const;
// force a codec
Expand Down
7 changes: 7 additions & 0 deletions src/VideoDecoderCUDA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class VideoDecoderCUDA : public VideoDecoder
public:
VideoDecoderCUDA();
virtual ~VideoDecoderCUDA();
virtual void flush();
virtual bool prepare();
virtual bool decode(const QByteArray &encoded);
virtual VideoFrame frame();
Expand Down Expand Up @@ -460,6 +461,12 @@ VideoDecoderCUDA::~VideoDecoderCUDA()
{
}

void VideoDecoderCUDA::flush()
{
DPTR_D(VideoDecoderCUDA);
d.frame_queue.clear();
}

bool VideoDecoderCUDA::prepare()
{
//TODO: destroy decoder
Expand Down

0 comments on commit 1f7c0fc

Please sign in to comment.