Additionally use the correct error number.
---
 libavformat/nutenc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 4e35e28..dd0f87e 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -778,8 +778,12 @@ static int nut_write_packet(AVFormatContext *s, AVPacket 
*pkt)
     int store_sp  = 0;
     int ret;
 
-    if (pkt->pts < 0)
-        return -1;
+    if (pkt->pts < 0) {
+        av_log(s, AV_LOG_ERROR,
+               "Negative pts not supported stream %d, pts %"PRId64"\n",
+               pkt->stream_index, pkt->pts);
+        return AVERROR_INVALIDDATA;
+    }
 
     if (1LL << (20 + 3 * nut->header_count) <= avio_tell(bc))
         write_headers(s, bc);
-- 
1.7.12

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

Reply via email to