Commit b3b0b35d authored by Martin Storsjö's avatar Martin Storsjö

movenc: Get rid of a hack for updating the dvc1 atom

Use the more generic approach with the delay_moov flag, instead of
having a update mechanism specific to this one single atom.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 847bf598
...@@ -447,9 +447,11 @@ static int mov_write_dvc1_structs(MOVTrack *track, uint8_t *buf) ...@@ -447,9 +447,11 @@ static int mov_write_dvc1_structs(MOVTrack *track, uint8_t *buf)
if (track->start_dts == AV_NOPTS_VALUE) { if (track->start_dts == AV_NOPTS_VALUE) {
/* No packets written yet, vc1_info isn't authoritative yet. */ /* No packets written yet, vc1_info isn't authoritative yet. */
/* Assume inline sequence and entry headers. This will be /* Assume inline sequence and entry headers. */
* overwritten at the end if the file is seekable. */
packet_seq = packet_entry = 1; packet_seq = packet_entry = 1;
av_log(NULL, AV_LOG_WARNING,
"moov atom written before any packets, unable to write correct "
"dvc1 atom. Set the delay_moov flag to fix this.\n");
} }
unescaped = av_mallocz(track->vos_len + FF_INPUT_BUFFER_PADDING_SIZE); unescaped = av_mallocz(track->vos_len + FF_INPUT_BUFFER_PADDING_SIZE);
...@@ -525,7 +527,6 @@ static int mov_write_dvc1_tag(AVIOContext *pb, MOVTrack *track) ...@@ -525,7 +527,6 @@ static int mov_write_dvc1_tag(AVIOContext *pb, MOVTrack *track)
avio_wb32(pb, track->vos_len + 8 + sizeof(buf)); avio_wb32(pb, track->vos_len + 8 + sizeof(buf));
ffio_wfourcc(pb, "dvc1"); ffio_wfourcc(pb, "dvc1");
track->vc1_info.struct_offset = avio_tell(pb);
avio_write(pb, buf, sizeof(buf)); avio_write(pb, buf, sizeof(buf));
avio_write(pb, track->vos_data, track->vos_len); avio_write(pb, track->vos_data, track->vos_len);
...@@ -4088,19 +4089,6 @@ static int mov_write_trailer(AVFormatContext *s) ...@@ -4088,19 +4089,6 @@ static int mov_write_trailer(AVFormatContext *s)
} }
} }
for (i = 0; i < mov->nb_streams; i++) {
if (mov->flags & FF_MOV_FLAG_FRAGMENT &&
mov->tracks[i].vc1_info.struct_offset && s->pb->seekable) {
int64_t off = avio_tell(pb);
uint8_t buf[7];
if (mov_write_dvc1_structs(&mov->tracks[i], buf) >= 0) {
avio_seek(pb, mov->tracks[i].vc1_info.struct_offset, SEEK_SET);
avio_write(pb, buf, 7);
avio_seek(pb, off, SEEK_SET);
}
}
}
error: error:
mov_free(s); mov_free(s);
......
...@@ -129,7 +129,6 @@ typedef struct MOVTrack { ...@@ -129,7 +129,6 @@ typedef struct MOVTrack {
unsigned frag_info_capacity; unsigned frag_info_capacity;
struct { struct {
int64_t struct_offset;
int first_packet_seq; int first_packet_seq;
int first_packet_entry; int first_packet_entry;
int packet_seq; int packet_seq;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment