From: Vishwanath Dixit <vdi...@akamai.com> --- libavformat/dashenc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index bdf8c8d..c0fe0a5 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -254,7 +254,9 @@ static int flush_dynbuf(OutputStream *os, int *range_length) // write out to file *range_length = avio_close_dyn_buf(os->ctx->pb, &buffer); os->ctx->pb = NULL; - avio_write(os->out, buffer + os->written_len, *range_length - os->written_len); + if (os->out) + avio_write(os->out, buffer + os->written_len, + *range_length - os->written_len); os->written_len = 0; av_free(buffer); @@ -1358,9 +1360,11 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt) write_styp(os->ctx->pb); avio_flush(os->ctx->pb); len = avio_get_dyn_buf (os->ctx->pb, &buf); - avio_write(os->out, buf + os->written_len, len - os->written_len); + if (os->out) { + avio_write(os->out, buf + os->written_len, len - os->written_len); + avio_flush(os->out); + } os->written_len = len; - avio_flush(os->out); } return ret; -- 1.9.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel