[FFmpeg-devel] [PATCH] The fail safe label fail1 should return -1, not 0.

2015-11-08 Thread canaar
---
 ffserver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffserver.c b/ffserver.c
index 1d4c8dc..bb89d53 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2425,7 +2425,7 @@ static int http_send_data(HTTPContext *c)
 /* fail safe - should never happen */
 fail1:
 c->buffer_ptr = c->buffer_end;
-return 0;
+return -1; /*Fail condition. Return -1*/
 }
 len = (c->buffer_ptr[0] << 24) |
 (c->buffer_ptr[1] << 16) |
-- 
2.4.0.GIT

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Return 0 in case of fail...

2015-11-06 Thread canaar

there's this snippet in ffserver.c :
  len = c->buffer_end - c->buffer_ptr;
if (len < 4) {
/* fail safe - should never happen */
fail1:  //I am 
talking about this label fail1

c->buffer_ptr = c->buffer_end;
return 0;
}
len = (c->buffer_ptr[0] << 24) |
(c->buffer_ptr[1] << 16) |
(c->buffer_ptr[2] << 8) |
(c->buffer_ptr[3]);
if (len > (c->buffer_end - c->buffer_ptr))
goto fail1;
1) Why does it return 0 in the case of a fail? It should return -1, 
right?

2) Unable to understand what the c->buffer contains.

Regards,
canaar
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Use of SDL mutex

2015-10-23 Thread canaar

Hey all,
I started reading ffplay.c today. I came a function/macro 
SDL_LockMutex(q->mutex) inside a packet enqueue function. Is this done 
to prevent other threads from accessing the queue, when one thread is 
processing on it?

Also, where can I get to read the algorithms used in ffplay?
Regards,
canaar
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel