mov: Support edit list atom version 1.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
parent
ced9556b61
commit
5f0bb0baef
@ -109,7 +109,7 @@ typedef struct MOVStreamContext {
|
|||||||
unsigned int keyframe_count;
|
unsigned int keyframe_count;
|
||||||
int *keyframes;
|
int *keyframes;
|
||||||
int time_scale;
|
int time_scale;
|
||||||
int time_offset; ///< time offset of the first edit list entry
|
int64_t time_offset; ///< time offset of the first edit list entry
|
||||||
int current_sample;
|
int current_sample;
|
||||||
unsigned int bytes_per_frame;
|
unsigned int bytes_per_frame;
|
||||||
unsigned int samples_per_frame;
|
unsigned int samples_per_frame;
|
||||||
|
@ -2163,13 +2163,13 @@ free_and_return:
|
|||||||
static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||||
{
|
{
|
||||||
MOVStreamContext *sc;
|
MOVStreamContext *sc;
|
||||||
int i, edit_count;
|
int i, edit_count, version;
|
||||||
|
|
||||||
if (c->fc->nb_streams < 1)
|
if (c->fc->nb_streams < 1)
|
||||||
return 0;
|
return 0;
|
||||||
sc = c->fc->streams[c->fc->nb_streams-1]->priv_data;
|
sc = c->fc->streams[c->fc->nb_streams-1]->priv_data;
|
||||||
|
|
||||||
avio_r8(pb); /* version */
|
version = avio_r8(pb); /* version */
|
||||||
avio_rb24(pb); /* flags */
|
avio_rb24(pb); /* flags */
|
||||||
edit_count = avio_rb32(pb); /* entries */
|
edit_count = avio_rb32(pb); /* entries */
|
||||||
|
|
||||||
@ -2177,9 +2177,15 @@ static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
for(i=0; i<edit_count; i++){
|
for(i=0; i<edit_count; i++){
|
||||||
int time;
|
int64_t time;
|
||||||
int duration = avio_rb32(pb); /* Track duration */
|
int64_t duration;
|
||||||
time = avio_rb32(pb); /* Media time */
|
if (version == 1) {
|
||||||
|
duration = avio_rb64(pb);
|
||||||
|
time = avio_rb64(pb);
|
||||||
|
} else {
|
||||||
|
duration = avio_rb32(pb); /* segment duration */
|
||||||
|
time = avio_rb32(pb); /* media time */
|
||||||
|
}
|
||||||
avio_rb32(pb); /* Media rate */
|
avio_rb32(pb); /* Media rate */
|
||||||
if (i == 0 && time >= -1) {
|
if (i == 0 && time >= -1) {
|
||||||
sc->time_offset = time != -1 ? time : -duration;
|
sc->time_offset = time != -1 ? time : -duration;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user