aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-20 11:06:09 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-20 11:06:23 +0200
commitc6526620a9a802e89f92c7f3469a6adbb321970c (patch)
treeed21006d6646c471026e1c3eefdc53ae70124f8d
parentc16470d77a1b693ea573e2925c3488847c5db939 (diff)
parentc53b5dda352452e79a9e962cd4c74c813186d9ed (diff)
downloadffmpeg-c6526620a9a802e89f92c7f3469a6adbb321970c.tar.gz
Merge commit 'c53b5dda352452e79a9e962cd4c74c813186d9ed'
* commit 'c53b5dda352452e79a9e962cd4c74c813186d9ed': asfdec: replace magic constant with DATA_HEADER_SIZE Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/asfenc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index 516e0d0e47..2727230453 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -183,6 +183,8 @@
1 - /* Payload Flags */ \
2 * PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS)
+#define DATA_HEADER_SIZE 50
+
typedef struct {
uint32_t seqno;
int is_streamed;
@@ -520,14 +522,14 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
cur_pos = avio_tell(pb);
header_size = cur_pos - header_offset;
if (asf->is_streamed) {
- header_size += 8 + 30 + 50;
+ header_size += 8 + 30 + DATA_HEADER_SIZE;
avio_seek(pb, header_offset - 10 - 30, SEEK_SET);
avio_wl16(pb, header_size);
avio_seek(pb, header_offset - 2 - 30, SEEK_SET);
avio_wl16(pb, header_size);
- header_size -= 8 + 30 + 50;
+ header_size -= 8 + 30 + DATA_HEADER_SIZE;
}
header_size += 24 + 6;
avio_seek(pb, header_offset - 14, SEEK_SET);
@@ -556,10 +558,10 @@ static int asf_write_header(AVFormatContext *s)
asf->nb_index_memory_alloc = ASF_INDEX_BLOCK;
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) {
+ /* the data-chunk-size has to be 50 (DATA_HEADER_SIZE), which is
+ * data_size - asf->data_offset at the moment this function is done.
+ * It is needed to use asf as a streamable format. */
+ if (asf_write_header1(s, 0, DATA_HEADER_SIZE) < 0) {
//av_free(asf);
return -1;
}