Use AVERROR(EAGAIN) to signal that the parser needs more data to
assemble a frame.
---
 libavcodec/parser.c | 2 +-
 libavcodec/parser.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 6d20516..e0525da 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -245,7 +245,7 @@ int ff_combine_frame(ParseContext *pc, int next,
         pc->buffer = new_buffer;
         memcpy(&pc->buffer[pc->index], *buf, *buf_size);
         pc->index += *buf_size;
-        return -1;
+        return AVERROR(EAGAIN);
     }
 
     *buf_size          =
diff --git a/libavcodec/parser.h b/libavcodec/parser.h
index ea1cae2..582ddc8 100644
--- a/libavcodec/parser.h
+++ b/libavcodec/parser.h
@@ -41,7 +41,7 @@ typedef struct ParseContext{
 
 /**
  * Combine the (truncated) bitstream to a complete frame.
- * @return -1 if no complete frame could be created,
+ * @return AVERROR(EAGAIN) if no complete frame could be created,
  *         AVERROR(ENOMEM) if there was a memory allocation error
  */
 int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int 
*buf_size);
-- 
1.8.3.2

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to