You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avformat/segafilmenc: Simplify writing two bytes
Use avio_wb16() instead of avio_write() to write two zero bytes. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
@@ -119,7 +119,6 @@ static int film_write_packet(AVFormatContext *format_context, AVPacket *pkt)
|
|||||||
if (encoded_buf_size != pkt->size && (pkt->size % encoded_buf_size) != 0) {
|
if (encoded_buf_size != pkt->size && (pkt->size % encoded_buf_size) != 0) {
|
||||||
avio_write(pb, pkt->data, pkt->size);
|
avio_write(pb, pkt->data, pkt->size);
|
||||||
} else {
|
} else {
|
||||||
uint8_t padding[2] = {0, 0};
|
|
||||||
/* In Sega Cinepak, the reported size in the Cinepak header is
|
/* In Sega Cinepak, the reported size in the Cinepak header is
|
||||||
* 8 bytes too short. However, the size in the STAB section of the header
|
* 8 bytes too short. However, the size in the STAB section of the header
|
||||||
* is correct, taking into account the extra two bytes. */
|
* is correct, taking into account the extra two bytes. */
|
||||||
@@ -127,7 +126,7 @@ static int film_write_packet(AVFormatContext *format_context, AVPacket *pkt)
|
|||||||
metadata->size += 2;
|
metadata->size += 2;
|
||||||
|
|
||||||
avio_write(pb, pkt->data, 10);
|
avio_write(pb, pkt->data, 10);
|
||||||
avio_write(pb, padding, 2);
|
avio_wb16(pb, 0);
|
||||||
avio_write(pb, &pkt->data[10], pkt->size - 10);
|
avio_write(pb, &pkt->data[10], pkt->size - 10);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user