summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-06-02 21:57:30 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-06-02 21:57:30 +0000
commitda9e6c42950ad74a4d2635ba81df53b22c595b69 (patch)
tree8cbd1bd3a880c66f1301c69d7007b5c69d07c797 /libavformat
parent652d9d24dc83fedfc62836aa3e8b92f5bc8cdb20 (diff)
Make write_streamheader() and write_headers() accept an
AVFormatContext * in input rather than a NUTContext *, which allows to log messages with av_log(). Originally committed as revision 23431 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/nutenc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 469672bc41..7e83da609e 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -391,7 +391,8 @@ static void write_mainheader(NUTContext *nut, ByteIOContext *bc){
}
}
-static int write_streamheader(NUTContext *nut, ByteIOContext *bc, AVStream *st, int i){
+static int write_streamheader(AVFormatContext *avctx, ByteIOContext *bc, AVStream *st, int i){
+ NUTContext *nut = avctx->priv_data;
AVCodecContext *codec = st->codec;
put_v(bc, i);
switch(codec->codec_type){
@@ -504,7 +505,8 @@ static int write_streaminfo(NUTContext *nut, ByteIOContext *bc, int stream_id){
return count;
}
-static int write_headers(NUTContext *nut, ByteIOContext *bc){
+static int write_headers(AVFormatContext *avctx, ByteIOContext *bc){
+ NUTContext *nut = avctx->priv_data;
ByteIOContext *dyn_bc;
int i, ret;
@@ -518,7 +520,7 @@ static int write_headers(NUTContext *nut, ByteIOContext *bc){
ret = url_open_dyn_buf(&dyn_bc);
if(ret < 0)
return ret;
- write_streamheader(nut, dyn_bc, nut->avf->streams[i], i);
+ write_streamheader(avctx, dyn_bc, nut->avf->streams[i], i);
put_packet(nut, bc, dyn_bc, 1, STREAM_STARTCODE);
}
@@ -592,7 +594,7 @@ static int write_header(AVFormatContext *s){
put_buffer(bc, ID_STRING, strlen(ID_STRING));
put_byte(bc, 0);
- write_headers(nut, bc);
+ write_headers(s, bc);
put_flush_packet(bc);
@@ -653,7 +655,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt){
return -1;
if(1LL<<(20+3*nut->header_count) <= url_ftell(bc))
- write_headers(nut, bc);
+ write_headers(s, bc);
if(key_frame && !(nus->last_flags & FLAG_KEY))
store_sp= 1;
@@ -797,7 +799,7 @@ static int write_trailer(AVFormatContext *s){
ByteIOContext *bc= s->pb;
while(nut->header_count<3)
- write_headers(nut, bc);
+ write_headers(s, bc);
put_flush_packet(bc);
ff_nut_free_sp(nut);
av_freep(&nut->stream);