[FFmpeg-devel] [PATCH 13/18] lavf/dv: return a meaningful error code from avpriv_dv_produce_packet()

Anton Khirnov anton at khirnov.net
Wed Aug 24 11:43:13 EEST 2022


---
 libavdevice/iec61883.c | 2 +-
 libavformat/dv.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavdevice/iec61883.c b/libavdevice/iec61883.c
index 7223ba2e64..a4b4ce2ef8 100644
--- a/libavdevice/iec61883.c
+++ b/libavdevice/iec61883.c
@@ -209,7 +209,7 @@ static int iec61883_parse_queue_dv(struct iec61883_data *dv, AVPacket *pkt)
     dv->packets--;
 
     if (size < 0)
-        return -1;
+        return size;
 
     if (av_packet_from_data(pkt, pkt->data, pkt->size) < 0) {
         av_freep(&pkt->data);
diff --git a/libavformat/dv.c b/libavformat/dv.c
index f88fe62349..c888111789 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -404,7 +404,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
     if (buf_size < DV_PROFILE_BYTES ||
         !(c->sys = av_dv_frame_profile(c->sys, buf, buf_size)) ||
         buf_size < c->sys->frame_size) {
-        return -1;   /* Broken frame, or not enough data */
+        return AVERROR_INVALIDDATA;
     }
 
     /* Queueing audio packet */
-- 
2.35.1



More information about the ffmpeg-devel mailing list