From a0c8e2670a885642002e9adb97d798d2361b38d3 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 2 Sep 2003 17:38:07 +0000 Subject: [PATCH] Proper CodecPrivate for video tracks. --- src/p_vorbis.cpp | 1 + src/qtmp4_atoms.h | 5 +++++ src/r_mp4.cpp | 8 ++++---- src/r_mp4.h | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/p_vorbis.cpp b/src/p_vorbis.cpp index 5c2b9a2de..38834d80a 100644 --- a/src/p_vorbis.cpp +++ b/src/p_vorbis.cpp @@ -192,6 +192,7 @@ int vorbis_packetizer_c::process(unsigned char *data, int size, return EMOREDATA; } + mxverb(2, "Vorbis: samples_here: %lld\n", samples_here); add_packet(data, size, (int64_t)timecode, (int64_t)(samples_here * 1000 * ti->async.linear / vi.rate)); diff --git a/src/qtmp4_atoms.h b/src/qtmp4_atoms.h index 40f92b604..ee5a17d68 100644 --- a/src/qtmp4_atoms.h +++ b/src/qtmp4_atoms.h @@ -136,4 +136,9 @@ typedef struct { uint16_t color_table_id; } video_stsd_atom_t; +typedef struct { + uint32_t size; + video_stsd_atom_t id; +} qt_image_description_t; + #endif // __QTMP4_ATOMS_H diff --git a/src/r_mp4.cpp b/src/r_mp4.cpp index cb2c69c20..5b6c727d5 100644 --- a/src/r_mp4.cpp +++ b/src/r_mp4.cpp @@ -478,11 +478,11 @@ void qtmp4_reader_c::handle_header_atoms(uint32_t parent, int64_t parent_size, new_dmx->v_height = get_uint16_be(&v_stsd.height); new_dmx->v_bitdepth = get_uint16_be(&v_stsd.depth); new_dmx->v_desc = - (video_stsd_atom_t *)safemalloc(size - 8); - io->setFilePointer(pos + 8); - if (io->read(new_dmx->v_desc, size - 8) != (size - 8)) + (qt_image_description_t *)safemalloc(size); + io->setFilePointer(pos); + if (io->read(new_dmx->v_desc, size) != size) throw exception(); - new_dmx->v_desc_size = size - 8; + new_dmx->v_desc_size = size; } io->setFilePointer(pos + size); diff --git a/src/r_mp4.h b/src/r_mp4.h index 462c8ccb8..33d690c88 100644 --- a/src/r_mp4.h +++ b/src/r_mp4.h @@ -91,7 +91,7 @@ typedef struct { uint32_t editlist_table_len; uint32_t v_width, v_height, v_bitdepth; - video_stsd_atom_t *v_desc; + qt_image_description_t *v_desc; uint32_t v_desc_size; uint32_t a_channels, a_bitdepth; float a_samplerate;