FlvRecordingMetaData metaData = metaDataDao.get(metaId);
BaseConverter.printMetaInfo(metaData, "Stopping the stream");
// Manually call finish on the stream so that there is no endless loop waiting in the FlvRecorderConverter waiting for the stream to finish
// this would normally happen in the Listener
Status s = metaData.getStreamStatus();
if (Status.NONE == s) {
log.debug("Stream was not started, no need to stop :: stream with id " + metaId);
} else {
metaData.setStreamStatus(listenerAdapter == null && s == Status.STARTED ? Status.STOPPED : Status.STOPPING);
log.debug("Stopping the stream :: New status == " + metaData.getStreamStatus());