Skip to content

Commit

Permalink
Disconnect sourcePlayers signal stopped from vfilter/afilter when
Browse files Browse the repository at this point in the history
stopping AVTranscoder.

The missing disconnect leads to a second call to finish of vfilter/afilter
which then leads to a segmentation fault in sync mode. In async mode
the segmentation fault does not happen because of a race condition
although a second call is executed. Always stop AVTranscoder first and
then the associated AVPlayer.
  • Loading branch information
Felix Matouschek committed Oct 12, 2017
1 parent 45fb210 commit 58245bb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/AVTranscoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ void AVTranscoder::stop()
// uninstall encoder filters first then encoders can be closed safely
if (sourcePlayer()) {
sourcePlayer()->uninstallFilter(d->afilter);
disconnect(sourcePlayer(), SIGNAL(stopped()), d->afilter, SLOT(finish()));
sourcePlayer()->uninstallFilter(d->vfilter);
disconnect(sourcePlayer(), SIGNAL(stopped()), d->vfilter, SLOT(finish()));
}
if (d->afilter)
d->afilter->finish(); //FIXME: thread of sync mode
Expand Down

0 comments on commit 58245bb

Please sign in to comment.