projects
/
rtmpclient.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clean the code, and fix bug service stopped when back pressed
[rtmpclient.git]
/
app
/
src
/
main
/
jni
/
FfmpegHelper.cpp
diff --git
a/app/src/main/jni/FfmpegHelper.cpp
b/app/src/main/jni/FfmpegHelper.cpp
index
3bd2f10
..
71d7064
100644
(file)
--- a/
app/src/main/jni/FfmpegHelper.cpp
+++ b/
app/src/main/jni/FfmpegHelper.cpp
@@
-157,7
+157,7
@@
int FfmpegHelper::processFrame(uint8_t* data)
{
if(!isEncoderReady){
FLOGE("processFrame - isEncoderReady is false.");
{
if(!isEncoderReady){
FLOGE("processFrame - isEncoderReady is false.");
- return
0
;
+ return
-1
;
}
int ret = 0;
int y_length = pWidth * pHeight;
}
int ret = 0;
int y_length = pWidth * pHeight;
@@
-236,11
+236,15
@@
int FfmpegHelper::processFrame(uint8_t* data)
int FfmpegHelper::close()
{
int FfmpegHelper::close()
{
- if(vStream)
+ if(vStream)
{
avcodec_close(vStream->codec);
avcodec_close(vStream->codec);
+ vStream = NULL;
+ }
+
if (formatCtx){
avio_close(formatCtx->pb);
avformat_free_context(formatCtx);
if (formatCtx){
avio_close(formatCtx->pb);
avformat_free_context(formatCtx);
+ formatCtx = NULL;
}
FLOGE("<----------- FfmpegHelper::close ");
isEncoderReady = false;
}
FLOGE("<----------- FfmpegHelper::close ");
isEncoderReady = false;