|
|
@ -68,7 +68,7 @@ static int seq_probe(AVProbeData *p) |
|
|
|
/* there's no real header in a .seq file, the only thing they have in common */ |
|
|
|
/* there's no real header in a .seq file, the only thing they have in common */ |
|
|
|
/* is the first 256 bytes of the file which are always filled with 0 */ |
|
|
|
/* is the first 256 bytes of the file which are always filled with 0 */ |
|
|
|
for (i = 0; i < 256; i++) |
|
|
|
for (i = 0; i < 256; i++) |
|
|
|
if (p->buf[i] != 0) |
|
|
|
if (p->buf[i]) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
|
|
if(p->buf[256]==0 && p->buf[257]==0) |
|
|
|
if(p->buf[256]==0 && p->buf[257]==0) |
|
|
@ -132,7 +132,7 @@ static int seq_parse_frame_data(SeqDemuxContext *seq, ByteIOContext *pb) |
|
|
|
|
|
|
|
|
|
|
|
/* sound data */ |
|
|
|
/* sound data */ |
|
|
|
seq->current_audio_data_offs = get_le16(pb); |
|
|
|
seq->current_audio_data_offs = get_le16(pb); |
|
|
|
if (seq->current_audio_data_offs != 0) { |
|
|
|
if (seq->current_audio_data_offs) { |
|
|
|
seq->current_audio_data_size = SEQ_AUDIO_BUFFER_SIZE * 2; |
|
|
|
seq->current_audio_data_size = SEQ_AUDIO_BUFFER_SIZE * 2; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
seq->current_audio_data_size = 0; |
|
|
|
seq->current_audio_data_size = 0; |
|
|
@ -140,7 +140,7 @@ static int seq_parse_frame_data(SeqDemuxContext *seq, ByteIOContext *pb) |
|
|
|
|
|
|
|
|
|
|
|
/* palette data */ |
|
|
|
/* palette data */ |
|
|
|
seq->current_pal_data_offs = get_le16(pb); |
|
|
|
seq->current_pal_data_offs = get_le16(pb); |
|
|
|
if (seq->current_pal_data_offs != 0) { |
|
|
|
if (seq->current_pal_data_offs) { |
|
|
|
seq->current_pal_data_size = 768; |
|
|
|
seq->current_pal_data_size = 768; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
seq->current_pal_data_size = 0; |
|
|
|
seq->current_pal_data_size = 0; |
|
|
@ -154,12 +154,12 @@ static int seq_parse_frame_data(SeqDemuxContext *seq, ByteIOContext *pb) |
|
|
|
offset_table[i] = get_le16(pb); |
|
|
|
offset_table[i] = get_le16(pb); |
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++) { |
|
|
|
for (i = 0; i < 3; i++) { |
|
|
|
if (offset_table[i] != 0) { |
|
|
|
if (offset_table[i]) { |
|
|
|
for (e = i + 1; e < 3 && offset_table[e] == 0; e++); |
|
|
|
for (e = i + 1; e < 3 && offset_table[e] == 0; e++); |
|
|
|
err = seq_fill_buffer(seq, pb, buffer_num[1 + i], |
|
|
|
err = seq_fill_buffer(seq, pb, buffer_num[1 + i], |
|
|
|
offset_table[i], |
|
|
|
offset_table[i], |
|
|
|
offset_table[e] - offset_table[i]); |
|
|
|
offset_table[e] - offset_table[i]); |
|
|
|
if (err != 0) |
|
|
|
if (err) |
|
|
|
return err; |
|
|
|
return err; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -254,13 +254,13 @@ static int seq_read_packet(AVFormatContext *s, AVPacket *pkt) |
|
|
|
return AVERROR(ENOMEM); |
|
|
|
return AVERROR(ENOMEM); |
|
|
|
|
|
|
|
|
|
|
|
pkt->data[0] = 0; |
|
|
|
pkt->data[0] = 0; |
|
|
|
if (seq->current_pal_data_size != 0) { |
|
|
|
if (seq->current_pal_data_size) { |
|
|
|
pkt->data[0] |= 1; |
|
|
|
pkt->data[0] |= 1; |
|
|
|
url_fseek(pb, seq->current_frame_offs + seq->current_pal_data_offs, SEEK_SET); |
|
|
|
url_fseek(pb, seq->current_frame_offs + seq->current_pal_data_offs, SEEK_SET); |
|
|
|
if (get_buffer(pb, &pkt->data[1], seq->current_pal_data_size) != seq->current_pal_data_size) |
|
|
|
if (get_buffer(pb, &pkt->data[1], seq->current_pal_data_size) != seq->current_pal_data_size) |
|
|
|
return AVERROR(EIO); |
|
|
|
return AVERROR(EIO); |
|
|
|
} |
|
|
|
} |
|
|
|
if (seq->current_video_data_size != 0) { |
|
|
|
if (seq->current_video_data_size) { |
|
|
|
pkt->data[0] |= 2; |
|
|
|
pkt->data[0] |= 2; |
|
|
|
memcpy(&pkt->data[1 + seq->current_pal_data_size], |
|
|
|
memcpy(&pkt->data[1 + seq->current_pal_data_size], |
|
|
|
seq->current_video_data_ptr, |
|
|
|
seq->current_video_data_ptr, |
|
|
|