aboutsummaryrefslogtreecommitdiff
path: root/libavformat/nutenc.c
diff options
context:
space:
mode:
authorStefano Sabatini2010-06-02 21:57:35 +0000
committerStefano Sabatini2010-06-02 21:57:35 +0000
commitfc0c41240edc45f3bcdfc863f82c4c5c656803f7 (patch)
tree1ae8d3b995a04212fc135d50ddefc6c64ea137e9 /libavformat/nutenc.c
parentda9e6c42950ad74a4d2635ba81df53b22c595b69 (diff)
Make write_header() and write_headers() return an error code in case of
error. Originally committed as revision 23432 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/nutenc.c')
-rw-r--r--libavformat/nutenc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 7e83da609e..21a0085c68 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -520,7 +520,8 @@ static int write_headers(AVFormatContext *avctx, ByteIOContext *bc){
ret = url_open_dyn_buf(&dyn_bc);
if(ret < 0)
return ret;
- write_streamheader(avctx, dyn_bc, nut->avf->streams[i], i);
+ if ((ret = write_streamheader(avctx, dyn_bc, nut->avf->streams[i], i)) < 0)
+ return ret;
put_packet(nut, bc, dyn_bc, 1, STREAM_STARTCODE);
}
@@ -554,7 +555,7 @@ static int write_headers(AVFormatContext *avctx, ByteIOContext *bc){
static int write_header(AVFormatContext *s){
NUTContext *nut = s->priv_data;
ByteIOContext *bc = s->pb;
- int i, j;
+ int i, j, ret;
nut->avf= s;
@@ -594,7 +595,8 @@ static int write_header(AVFormatContext *s){
put_buffer(bc, ID_STRING, strlen(ID_STRING));
put_byte(bc, 0);
- write_headers(s, bc);
+ if ((ret = write_headers(s, bc)) < 0)
+ return ret;
put_flush_packet(bc);