[FFmpeg-devel] [PATCH] h264_mp4toannexb

2015-10-09 Thread
From 9654bf635c72fd3bd4208afcf4a1b8b8667735db Mon Sep 17 00:00:00 2001
From: zylthinking 
Date: Fri, 9 Oct 2015 13:46:45 +0800
Subject: [PATCH] fix pps offfset fault when there are more than one sps in
 avcc

the pps offset is used to locate pps in the spspps_buf; however, the
current calc method maybe be wrong because it is the offset of the original
avctx->extradata;
when there is only one sps in the avcc; the value is correct by
coincidence, however, it will
fail in avcc with multi sps
---
 libavcodec/h264_mp4toannexb_bsf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264_mp4toannexb_bsf.c
b/libavcodec/h264_mp4toannexb_bsf.c
index a5da84a..6c620fa 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -122,7 +122,7 @@ pps:
 if (!unit_nb && !sps_done++) {
 unit_nb = *extradata++; /* number of pps unit(s) */
 if (unit_nb) {
-ctx->pps_offset = (extradata - 1) - (avctx->extradata + 4);
+ctx->pps_offset = total_size;
 pps_seen = 1;
 }
 }
-- 
2.3.4
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] hls, libstagefright

2015-09-23 Thread
From f5ff9a07a755123c259f6483fa3c55be1bb41abf Mon Sep 17 00:00:00 2001
From: zylthinking 
Date: Wed, 23 Sep 2015 12:55:27 +0800
Subject: [PATCH] initialize duration of a living hls stream to an known
value

Signed-off-by: zylthinking 
---
 libavformat/hls.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index adaa33a..23c541f 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1380,6 +1380,7 @@ static int hls_read_header(AVFormatContext *s)

 /* If this isn't a live stream, calculate the total duration of the
  * stream. */
+s->duration = -1;
 if (c->variants[0]->playlists[0]->finished) {
 int64_t duration = 0;
 for (i = 0; i < c->variants[0]->playlists[0]->n_segments; i++)
-- 
2.3.4




From 3d0f0ab34997f8ca6f466b18be5c8fc4366c8a2a Mon Sep 17 00:00:00 2001
From: zylthinking 
Date: Wed, 23 Sep 2015 13:01:44 +0800
Subject: [PATCH] fix Stagefright_decode_frame may not exiting when source
done

Signed-off-by: zylthinking 
---
 libavcodec/libstagefright.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libstagefright.cpp b/libavcodec/libstagefright.cpp
index f4b38e6..07cac33 100644
--- a/libavcodec/libstagefright.cpp
+++ b/libavcodec/libstagefright.cpp
@@ -433,7 +433,7 @@ static int Stagefright_decode_frame(AVCodecContext
*avctx, void *data,
 pthread_mutex_lock(>out_mutex);
 if (!s->out_queue->empty()) break;
 pthread_mutex_unlock(>out_mutex);
-if (s->source_done) {
+if (!s->source_done) {
 usleep(1);
 continue;
 } else {
-- 
2.3.4
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel