Skip to content

Commit

Permalink
avdevice/iec61883: #if unused code away, fix -O0 compilation
Browse files Browse the repository at this point in the history
iec61883_parse_queue_hdv() is only called when the mpegts-demuxer
is available and can be optimized away when not. Yet this
optimization is not a given and it fails with e.g. GCC 11 when
using -O0 in which case one will get a compilation error
because the call to the unavailable avpriv_mpegts_parse_packet()
is not optimized away. Therefore #if the offending code away
in this case.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
  • Loading branch information
mkver committed Jan 8, 2022
1 parent 2d0b17e commit ad0b4af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libavdevice/iec61883.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ static int iec61883_parse_queue_dv(struct iec61883_data *dv, AVPacket *pkt)

static int iec61883_parse_queue_hdv(struct iec61883_data *dv, AVPacket *pkt)
{
#if CONFIG_MPEGTS_DEMUXER
DVPacket *packet;
int size;

Expand All @@ -235,7 +236,7 @@ static int iec61883_parse_queue_hdv(struct iec61883_data *dv, AVPacket *pkt)
if (size > 0)
return size;
}

#endif
return -1;
}

Expand Down

0 comments on commit ad0b4af

Please sign in to comment.