diff options
author | Oded Shimon <ods15@ods15.dyndns.org> | 2006-11-16 10:33:25 +0300 |
---|---|---|
committer | Oded Shimon <ods15@ods15.dyndns.org> | 2006-11-16 10:33:25 +0300 |
commit | e4bb70838f0c3092a9b893f2210e7c303f0f2a4a (patch) | |
tree | dec28e4aba18f9e4c4767db1e62f4f3104d5a2ad /libavformat/libnut.c | |
parent | 3666f75d336191578d84d790cccfae03da00f9f2 (diff) |
Update to libnut API, non-negative errors
Originally committed as revision 7094 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/libnut.c')
-rw-r--r-- | libavformat/libnut.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavformat/libnut.c b/libavformat/libnut.c index 3128c1f9f4..fe5efca748 100644 --- a/libavformat/libnut.c +++ b/libavformat/libnut.c @@ -206,7 +206,7 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) { int ret, i; if ((ret = nut_read_headers(nut, &s, NULL))) { - if (ret < 0) av_log(avf, AV_LOG_ERROR, " NUT error: %s\n", nut_error(-ret)); + av_log(avf, AV_LOG_ERROR, " NUT error: %s\n", nut_error(ret)); nut_demuxer_uninit(nut); return -1; } @@ -262,10 +262,13 @@ static int nut_read_packet(AVFormatContext * avf, AVPacket * pkt) { nut_packet_t pd; int ret; - while ((ret = nut_read_next_packet(priv->nut, &pd)) < 0) - av_log(avf, AV_LOG_ERROR, " NUT error: %s\n", nut_error(-ret)); + ret = nut_read_next_packet(priv->nut, &pd); - if (ret || av_new_packet(pkt, pd.len) < 0) return -1; + if (ret || av_new_packet(pkt, pd.len) < 0) { + if (ret != NUT_ERR_EOF) + av_log(avf, AV_LOG_ERROR, " NUT error: %s\n", nut_error(ret)); + return -1; + } if (pd.flags & NUT_FLAG_KEY) pkt->flags |= PKT_FLAG_KEY; pkt->pts = pd.pts; |