You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avformat/aptxdec: Don't set AV_PKT_FLAG_CORRUPT mistakenly
Just because we try to put multiple units of block_align bytes (the atomic units for APTX and APTX HD) into one packet does not mean that packets with fewer units than the one we wanted are corrupt; only those packets that are not a multiple of block_align are. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -74,12 +74,18 @@ static int aptx_hd_read_header(AVFormatContext *s)
|
|||||||
|
|
||||||
static int aptx_read_packet(AVFormatContext *s, AVPacket *pkt)
|
static int aptx_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
{
|
{
|
||||||
return av_get_packet(s->pb, pkt, APTX_PACKET_SIZE);
|
int ret = av_get_packet(s->pb, pkt, APTX_PACKET_SIZE);
|
||||||
|
if (ret >= 0 && !(ret % APTX_BLOCK_SIZE))
|
||||||
|
pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
|
||||||
|
return ret >= 0 ? 0 : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int aptx_hd_read_packet(AVFormatContext *s, AVPacket *pkt)
|
static int aptx_hd_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
{
|
{
|
||||||
return av_get_packet(s->pb, pkt, APTX_HD_PACKET_SIZE);
|
int ret = av_get_packet(s->pb, pkt, APTX_HD_PACKET_SIZE);
|
||||||
|
if (ret >= 0 && !(ret % APTX_HD_BLOCK_SIZE))
|
||||||
|
pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
|
||||||
|
return ret >= 0 ? 0 : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const AVOption aptx_options[] = {
|
static const AVOption aptx_options[] = {
|
||||||
|
Reference in New Issue
Block a user