From 574ec1f9c69fbe9105d86bb5ed271089b3ae469b Mon Sep 17 00:00:00 2001 From: ireader Date: Sat, 27 Apr 2024 10:32:53 +0800 Subject: [PATCH] change: skip fmp4 miss track --- libmov/source/mov-tfra.c | 5 ++++- libmov/test/fmp4-writer-test2.cpp | 2 +- libmov/test/mov-reader-test.cpp | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libmov/source/mov-tfra.c b/libmov/source/mov-tfra.c index ff4c605b..3b80090b 100644 --- a/libmov/source/mov-tfra.c +++ b/libmov/source/mov-tfra.c @@ -19,7 +19,10 @@ int mov_read_tfra(struct mov_t* mov, const struct mov_box_t* box) track = mov_find_track(mov, track_ID); if (NULL == track) - return -1; + { + mov_buffer_skip(&mov->io, box->size - 8); + return mov_buffer_error(&mov->io); + } length_size_of = mov_buffer_r32(&mov->io); /* length_size_of XXX */ number_of_entry = mov_buffer_r32(&mov->io); /* number_of_entry */ diff --git a/libmov/test/fmp4-writer-test2.cpp b/libmov/test/fmp4-writer-test2.cpp index 374219ba..cc2c0c7d 100644 --- a/libmov/test/fmp4-writer-test2.cpp +++ b/libmov/test/fmp4-writer-test2.cpp @@ -52,5 +52,5 @@ void fmp4_writer_test2(const char* mp4, const char* outmp4) fmp4_writer_destroy(fmp4); mov_reader_destroy(mov); fclose(wfile.fp); - fclose(wfile.fp); + fclose(file.fp); } diff --git a/libmov/test/mov-reader-test.cpp b/libmov/test/mov-reader-test.cpp index 85ddc685..319ed6d3 100644 --- a/libmov/test/mov-reader-test.cpp +++ b/libmov/test/mov-reader-test.cpp @@ -114,8 +114,7 @@ static void onread(void* flv, uint32_t track, const void* buffer, size_t bytes, //int n = aom_av1_codec_configuration_record_save(&s_av1, s_packet, sizeof(s_packet)); //fwrite(s_packet, 1, n, s_vfp); } - - else if (it->second == "ACC") + else if (it->second == "AAC") { printf("[AAC] pts: %s, dts: %s, diff: %03d/%03d, bytes: %u\n", ftimestamp(pts, s_pts), ftimestamp(dts, s_dts), (int)(pts - a_pts), (int)(dts - a_dts), (unsigned int)bytes); a_pts = pts;