Re: [FFmpeg-devel] [PATCH] hls, libstagefright

2015-09-23 Thread Michael Niedermayer
On Wed, Sep 23, 2015 at 01:05:53PM +0800, 赵宇龙 wrote:
> 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++)

can you explain why this does make a difference ?


[...]
> 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(-)

patch applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] hls, libstagefright

2015-09-23 Thread Ganesh Ajjanagadde
On Wed, Sep 23, 2015 at 7:09 AM, Michael Niedermayer  wrote:
> On Wed, Sep 23, 2015 at 01:05:53PM +0800, 赵宇龙 wrote:
>> 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++)
>
> can you explain why this does make a difference ?
>
>
> [...]
>> 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(-)
>
> patch applied

Unrelated, but perhaps of interest more generally:
https://en.wikipedia.org/wiki/Stagefright_%28bug%29 - this made a big
splash as a security vulnerability.

>
> thanks
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> If a bugfix only changes things apparently unrelated to the bug with no
> further explanation, that is a good sign that the bugfix is wrong.
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
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