History

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.

Andreas Rheinhardt committed 5 years ago

Commit c8707c11 parent 9d10d3a1 file · +8 −2Browse files

Unified · Split

libavformat/aptxdec.c+8−2
@@ -74,12 +74,18 @@ static int aptx_hd_read_header(AVFormatContext *s) · 73 unmodified lines
7474
7575 static int aptx_read_packet(AVFormatContext *s, AVPacket *pkt)
7676 {
77− return av_get_packet(s->pb, pkt, APTX_PACKET_SIZE);
77+ int ret = av_get_packet(s->pb, pkt, APTX_PACKET_SIZE);
78+ if (ret >= 0 && !(ret % APTX_BLOCK_SIZE))
79+ pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
80+ return ret >= 0 ? 0 : ret;
7881 }
7982
8083 static int aptx_hd_read_packet(AVFormatContext *s, AVPacket *pkt)
8184 {
82− return av_get_packet(s->pb, pkt, APTX_HD_PACKET_SIZE);
85+ int ret = av_get_packet(s->pb, pkt, APTX_HD_PACKET_SIZE);
86+ if (ret >= 0 && !(ret % APTX_HD_BLOCK_SIZE))
87+ pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
88+ return ret >= 0 ? 0 : ret;
8389 }
8490
8591 static const AVOption aptx_options[] = {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t