mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-16 20:31:32 +00:00
asfdec: replace magic constant with DATA_HEADER_SIZE
Signed-off-by: Vladimir Pantelic <vladoman@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
5f40833360
commit
c53b5dda35
@ -182,6 +182,8 @@
|
|||||||
1 - /* Payload Flags */ \
|
1 - /* Payload Flags */ \
|
||||||
2 * PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS)
|
2 * PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS)
|
||||||
|
|
||||||
|
#define DATA_HEADER_SIZE 50
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t seqno;
|
uint32_t seqno;
|
||||||
int is_streamed;
|
int is_streamed;
|
||||||
@ -517,14 +519,14 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
|
|||||||
cur_pos = avio_tell(pb);
|
cur_pos = avio_tell(pb);
|
||||||
header_size = cur_pos - header_offset;
|
header_size = cur_pos - header_offset;
|
||||||
if (asf->is_streamed) {
|
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_seek(pb, header_offset - 10 - 30, SEEK_SET);
|
||||||
avio_wl16(pb, header_size);
|
avio_wl16(pb, header_size);
|
||||||
avio_seek(pb, header_offset - 2 - 30, SEEK_SET);
|
avio_seek(pb, header_offset - 2 - 30, SEEK_SET);
|
||||||
avio_wl16(pb, header_size);
|
avio_wl16(pb, header_size);
|
||||||
|
|
||||||
header_size -= 8 + 30 + 50;
|
header_size -= 8 + 30 + DATA_HEADER_SIZE;
|
||||||
}
|
}
|
||||||
header_size += 24 + 6;
|
header_size += 24 + 6;
|
||||||
avio_seek(pb, header_offset - 14, SEEK_SET);
|
avio_seek(pb, header_offset - 14, SEEK_SET);
|
||||||
@ -555,10 +557,10 @@ static int asf_write_header(AVFormatContext *s)
|
|||||||
asf->nb_index_count = 0;
|
asf->nb_index_count = 0;
|
||||||
asf->maximum_packet = 0;
|
asf->maximum_packet = 0;
|
||||||
|
|
||||||
/* the data-chunk-size has to be 50, which is data_size - asf->data_offset
|
/* the data-chunk-size has to be 50 (DATA_HEADER_SIZE), which is
|
||||||
* at the moment this function is done. It is needed to use asf as
|
* data_size - asf->data_offset at the moment this function is done.
|
||||||
* streamable format. */
|
* It is needed to use asf as a streamable format. */
|
||||||
if (asf_write_header1(s, 0, 50) < 0) {
|
if (asf_write_header1(s, 0, DATA_HEADER_SIZE) < 0) {
|
||||||
//av_free(asf);
|
//av_free(asf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user