Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
124
Issues
124
List
Boards
Labels
Milestones
Security & Compliance
Security & Compliance
Dependency List
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
4fba37f6
Commit
4fba37f6
authored
Dec 10, 2018
by
Philippe Gorley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localrecorder: fix crash on stop
Change-Id: I11ac40fa68bf6bd94d5aaae9246e5bd1e1a556b6
parent
4d480644
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
src/media/localrecorder.cpp
src/media/localrecorder.cpp
+9
-4
src/media/localrecorder.h
src/media/localrecorder.h
+4
-6
No files found.
src/media/localrecorder.cpp
View file @
4fba37f6
...
@@ -36,6 +36,12 @@ LocalRecorder::LocalRecorder(const bool& audioOnly)
...
@@ -36,6 +36,12 @@ LocalRecorder::LocalRecorder(const bool& audioOnly)
recorder_
->
audioOnly
(
audioOnly
);
recorder_
->
audioOnly
(
audioOnly
);
}
}
LocalRecorder
::~
LocalRecorder
()
{
if
(
isRecording
())
stopRecording
();
}
void
void
LocalRecorder
::
setPath
(
const
std
::
string
&
path
)
LocalRecorder
::
setPath
(
const
std
::
string
&
path
)
{
{
...
@@ -94,15 +100,14 @@ LocalRecorder::startRecording()
...
@@ -94,15 +100,14 @@ LocalRecorder::startRecording()
void
void
LocalRecorder
::
stopRecording
()
LocalRecorder
::
stopRecording
()
{
{
Recordable
::
stopRecording
();
Manager
::
instance
().
getRingBufferPool
().
unBindHalfDuplexOut
(
path_
,
RingBufferPool
::
DEFAULT_ID
);
if
(
auto
ob
=
recorder_
->
getStream
(
audioInput_
->
getInfo
().
name
))
if
(
auto
ob
=
recorder_
->
getStream
(
audioInput_
->
getInfo
().
name
))
audioInput_
->
detach
(
ob
);
audioInput_
->
detach
(
ob
);
if
(
videoInput_
)
if
(
videoInput_
)
if
(
auto
ob
=
recorder_
->
getStream
(
videoInput_
->
getInfo
().
name
))
if
(
auto
ob
=
recorder_
->
getStream
(
videoInput_
->
getInfo
().
name
))
videoInput_
->
detach
(
ob
);
videoInput_
->
detach
(
ob
);
audioInput_
.
reset
();
Manager
::
instance
().
getRingBufferPool
().
unBindHalfDuplexOut
(
path_
,
RingBufferPool
::
DEFAULT_ID
);
videoInput_
.
reset
();
// NOTE stopRecording should be last call to avoid data races
Recordable
::
stopRecording
();
}
}
}
// namespace ring
}
// namespace ring
src/media/localrecorder.h
View file @
4fba37f6
...
@@ -40,13 +40,8 @@ namespace ring {
...
@@ -40,13 +40,8 @@ namespace ring {
class
LocalRecorder
:
public
Recordable
{
class
LocalRecorder
:
public
Recordable
{
public:
public:
/**
* Constructor of a LocalRecorder.
* Passed VideoInput pointer will be used for recording.
* If input pointer in null, video recording will be disabled on this
* recorder.
*/
LocalRecorder
(
const
bool
&
audioOnly
);
LocalRecorder
(
const
bool
&
audioOnly
);
~
LocalRecorder
();
/**
/**
* Start local recording. Return true if recording was successfully
* Start local recording. Return true if recording was successfully
...
@@ -54,6 +49,9 @@ class LocalRecorder : public Recordable {
...
@@ -54,6 +49,9 @@ class LocalRecorder : public Recordable {
*/
*/
bool
startRecording
();
bool
startRecording
();
/**
* Stops recording.
*/
void
stopRecording
();
void
stopRecording
();
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment