mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/matroskaenc: add an option to disable writting CRC32 elements
Also add missing Changelog entry. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
3bcadf8227
commit
711bfb33df
|
@ -35,6 +35,7 @@ version <next>:
|
||||||
- sdl1 output device and sdl1 support removed
|
- sdl1 output device and sdl1 support removed
|
||||||
- extended mov edit list support
|
- extended mov edit list support
|
||||||
- libfaac encoder removed
|
- libfaac encoder removed
|
||||||
|
- Matroska muxer now writes CRC32 elements by default in all Level 1 elements
|
||||||
|
|
||||||
|
|
||||||
version 3.1:
|
version 3.1:
|
||||||
|
|
|
@ -134,6 +134,7 @@ typedef struct MatroskaMuxContext {
|
||||||
int is_dash;
|
int is_dash;
|
||||||
int dash_track_number;
|
int dash_track_number;
|
||||||
int is_live;
|
int is_live;
|
||||||
|
int write_crc;
|
||||||
|
|
||||||
uint32_t chapter_id_offset;
|
uint32_t chapter_id_offset;
|
||||||
int wrote_chapters;
|
int wrote_chapters;
|
||||||
|
@ -334,7 +335,7 @@ static void end_ebml_master_crc32(AVIOContext *pb, AVIOContext **dyn_cp, Matrosk
|
||||||
|
|
||||||
if (pb->seekable) {
|
if (pb->seekable) {
|
||||||
size = avio_close_dyn_buf(*dyn_cp, &buf);
|
size = avio_close_dyn_buf(*dyn_cp, &buf);
|
||||||
if (mkv->mode != MODE_WEBM) {
|
if (mkv->write_crc && mkv->mode != MODE_WEBM) {
|
||||||
AV_WL32(crc, av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), UINT32_MAX, buf, size) ^ UINT32_MAX);
|
AV_WL32(crc, av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), UINT32_MAX, buf, size) ^ UINT32_MAX);
|
||||||
put_ebml_binary(pb, EBML_ID_CRC32, crc, sizeof(crc));
|
put_ebml_binary(pb, EBML_ID_CRC32, crc, sizeof(crc));
|
||||||
}
|
}
|
||||||
|
@ -1485,7 +1486,7 @@ static int mkv_write_tags(AVFormatContext *s)
|
||||||
|
|
||||||
if (mkv->tags.pos) {
|
if (mkv->tags.pos) {
|
||||||
if (s->pb->seekable && !mkv->is_live)
|
if (s->pb->seekable && !mkv->is_live)
|
||||||
put_ebml_void(s->pb, avio_tell(mkv->tags_bc) + ((mkv->mode != MODE_WEBM) ? 2 /* ebml id + data size */ + 4 /* CRC32 */ : 0));
|
put_ebml_void(s->pb, avio_tell(mkv->tags_bc) + ((mkv->write_crc && mkv->mode != MODE_WEBM) ? 2 /* ebml id + data size */ + 4 /* CRC32 */ : 0));
|
||||||
else
|
else
|
||||||
end_ebml_master_crc32(s->pb, &mkv->tags_bc, mkv, mkv->tags);
|
end_ebml_master_crc32(s->pb, &mkv->tags_bc, mkv, mkv->tags);
|
||||||
}
|
}
|
||||||
|
@ -1729,7 +1730,7 @@ static int mkv_write_header(AVFormatContext *s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s->pb->seekable)
|
if (s->pb->seekable)
|
||||||
put_ebml_void(s->pb, avio_tell(pb) + ((mkv->mode != MODE_WEBM) ? 2 /* ebml id + data size */ + 4 /* CRC32 */ : 0));
|
put_ebml_void(s->pb, avio_tell(pb) + ((mkv->write_crc && mkv->mode != MODE_WEBM) ? 2 /* ebml id + data size */ + 4 /* CRC32 */ : 0));
|
||||||
else
|
else
|
||||||
end_ebml_master_crc32(s->pb, &mkv->info_bc, mkv, mkv->info);
|
end_ebml_master_crc32(s->pb, &mkv->info_bc, mkv, mkv->info);
|
||||||
pb = s->pb;
|
pb = s->pb;
|
||||||
|
@ -2390,6 +2391,7 @@ static const AVOption options[] = {
|
||||||
{ "dash_track_number", "Track number for the DASH stream", OFFSET(dash_track_number), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 127, FLAGS },
|
{ "dash_track_number", "Track number for the DASH stream", OFFSET(dash_track_number), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 127, FLAGS },
|
||||||
{ "live", "Write files assuming it is a live stream.", OFFSET(is_live), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
|
{ "live", "Write files assuming it is a live stream.", OFFSET(is_live), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
|
||||||
{ "allow_raw_vfw", "allow RAW VFW mode", OFFSET(allow_raw_vfw), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
|
{ "allow_raw_vfw", "allow RAW VFW mode", OFFSET(allow_raw_vfw), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
|
||||||
|
{ "write_crc32", "write a CRC32 element inside every Level 1 element", OFFSET(write_crc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
// Also please add any ticket numbers that you believe might be affected here
|
// Also please add any ticket numbers that you believe might be affected here
|
||||||
#define LIBAVFORMAT_VERSION_MAJOR 57
|
#define LIBAVFORMAT_VERSION_MAJOR 57
|
||||||
#define LIBAVFORMAT_VERSION_MINOR 51
|
#define LIBAVFORMAT_VERSION_MINOR 51
|
||||||
#define LIBAVFORMAT_VERSION_MICRO 102
|
#define LIBAVFORMAT_VERSION_MICRO 103
|
||||||
|
|
||||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||||
LIBAVFORMAT_VERSION_MINOR, \
|
LIBAVFORMAT_VERSION_MINOR, \
|
||||||
|
|
Loading…
Reference in New Issue