Hi there!
I’m getting a windows error window when trying to play videos one after the other using ofGstVideoPlayer on windows after a while.
Windows Error msg :
It looks like some memory leak to me, this could well be with the way i’m loading and playing the videos (see below test case code)
When runnig the test case i do first get this error output for every player.loadMovie(path):
I assumed it was link to this known “issue” : ofVideoPlayer > GStreamer-CRITICAL **: gst_mini_object_unref: assertion So maybe nothing to do with the more problematic crashing behaviour.
aim: playing a lot of videos that seamlessly link to eachother for a long time.
After around 100 occurrences of video playing I do get a new error message when loading the video :
After 1769 loadMovie occurences try i do get again the above gmem.c Windows Error message.
It does look like i’m not clearing up / stopping the video pipeline correctly i’d thought that
or
would do, but no luck.
Any idea where my code fails ? Or any pointer on how to hunt such issue would be welcome.
Thank you.
This is the test case i’m using :
#include "ofApp.h"
#include "ofGstVideoPlayer.h"
ofVideoPlayer * vidPlayer;
string path;
int nTests;
//--------------------------------------------------------------
void ofApp::setup(){
ofSetLogLevel( OF_LOG_VERBOSE );
// player
vidPlayer = new ofVideoPlayer();
vidPlayer->setPlayer(ofPtr<ofGstVideoPlayer>(new ofGstVideoPlayer()));
// path
path = "movie.mp4";
nTests = 0;
// go
playNext();
}
void ofApp::update(){
if(vidPlayer->isLoaded())
vidPlayer->update();
if( vidPlayer->getIsMovieDone() == true ){
// play next vid when previous one is done
vidPlayer->close();
playNext();
}
};
void ofApp::playNext(){
nTests ++;
vidPlayer->close();
if(!vidPlayer->isPlaying()){
vidPlayer->loadMovie(path);
vidPlayer->update();
}
vidPlayer->play();
};
void ofApp::draw(){
vidPlayer->draw(ofPoint(0,0));
// display number of video test
ofSetColor(255,255,255);
ofDrawBitmapString("nTest:" + ofToString(nTests) , 20,20 ,0);
};
void ofApp::keyPressed(int key){
switch(key){
case (OF_KEY_RIGHT ):
playNext();
break;
}
};