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

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/aptxdec.c+8−2
@@ -74,12 +74,18 @@ static int aptx_hd_read_header(AVFormatContext *s) · 73 unmodified lines
74 74
75static int aptx_read_packet(AVFormatContext *s, AVPacket *pkt)75static int aptx_read_packet(AVFormatContext *s, AVPacket *pkt)
76{76{
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;
78}81}
79 82
80static int aptx_hd_read_packet(AVFormatContext *s, AVPacket *pkt)83static int aptx_hd_read_packet(AVFormatContext *s, AVPacket *pkt)
81{84{
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;
83}89}
84 90
85static const AVOption aptx_options[] = {91static 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