X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fasf-enc.c;h=736c1365af02e30d19e61c112f7a096eba7f6f52;hb=6b6adf2bc86ba4b432554c054ef0470ba34d74ac;hp=fa3a9b2945c9c5b7b6c563bab02445b9cc6f852f;hpb=3caa0d9343b35d44db21ef362a1536df0ce15188;p=ffmpeg diff --git a/libavformat/asf-enc.c b/libavformat/asf-enc.c index fa3a9b2945c..736c1365af0 100644 --- a/libavformat/asf-enc.c +++ b/libavformat/asf-enc.c @@ -311,7 +311,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data put_le64(pb, duration); /* end time stamp (in 100ns units) */ put_le64(pb, asf->duration); /* duration (in 100ns units) */ put_le64(pb, PREROLL_TIME); /* start time stamp */ - put_le32(pb, asf->is_streamed ? 3 : 2); /* ??? */ + put_le32(pb, (asf->is_streamed || url_is_streamed(pb)) ? 3 : 2); /* ??? */ put_le32(pb, asf->packet_size); /* packet size */ put_le32(pb, asf->packet_size); /* packet size */ put_le32(pb, bit_rate); /* Nominal data rate in bps */ @@ -498,6 +498,9 @@ static int asf_write_header(AVFormatContext *s) asf->nb_index_count = 0; asf->maximum_packet = 0; + /* the data-chunk-size has to be 50, which is data_size - asf->data_offset + * at the moment this function is done. It is needed to use asf as + * streamable format. */ if (asf_write_header1(s, 0, 50) < 0) { //av_free(asf); return -1; @@ -796,7 +799,7 @@ static int asf_write_trailer(AVFormatContext *s) } put_flush_packet(&s->pb); - if (asf->is_streamed) { + if (asf->is_streamed || url_is_streamed(&s->pb)) { put_chunk(s, 0x4524, 0, 0); /* end of stream */ } else { /* rewrite an updated header */