[FFmpeg-devel] [PATCH] hls, libstagefright

赵宇龙 zylthinking at gmail.com
Wed Sep 23 07:05:53 CEST 2015


>From f5ff9a07a755123c259f6483fa3c55be1bb41abf Mon Sep 17 00:00:00 2001
From: zylthinking <zylthinking at gmail.com>
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 <zylthinking at gmail.com>
---
 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 <zylthinking at gmail.com>
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 <zylthinking at gmail.com>
---
 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(&s->out_mutex);
         if (!s->out_queue->empty()) break;
         pthread_mutex_unlock(&s->out_mutex);
-        if (s->source_done) {
+        if (!s->source_done) {
             usleep(10000);
             continue;
         } else {
-- 
2.3.4


More information about the ffmpeg-devel mailing list