am7xxx-play: use AVStream.codecpar instead of the deprecated AVStream.codec
authorAntonio Ospite <ao2@ao2.it>
Wed, 28 Feb 2018 11:48:31 +0000 (12:48 +0100)
committerAntonio Ospite <ao2@ao2.it>
Thu, 1 Mar 2018 14:33:27 +0000 (15:33 +0100)
commit8aa04859fc68aeab28d08a1c7d97ef5a0f7ce050
treee5663a796ebcc11bd5ae418e1c0decd83754201c
parent7193dbf2d47df0d9e317d41543292004940cc047
am7xxx-play: use AVStream.codecpar instead of the deprecated AVStream.codec

AVStream.codec has been deprecated and AVStream.codecpar should be used
instead, as shown in:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commitdiff;h=9200514ad8717c63f82101dc394f4378854325bf

The changes fix the following compilation warnings:

  .../libam7xxx/examples/am7xxx-play.c: In function ‘video_input_init’:
  .../libam7xxx/examples/am7xxx-play.c:104:3: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
     if (input_format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
     ^~
  In file included from /usr/include/x86_64-linux-gnu/libavdevice/avdevice.h:51:0,
                   from .../libam7xxx/examples/am7xxx-play.c:32:
  /usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
       AVCodecContext *codec;
                       ^~~~~
  .../libam7xxx/examples/am7xxx-play.c:115:2: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
    input_codec_ctx = input_format_ctx->streams[video_index]->codec;
    ^~~~~~~~~~~~~~~
  In file included from /usr/include/x86_64-linux-gnu/libavdevice/avdevice.h:51:0,
                   from .../libam7xxx/examples/am7xxx-play.c:32:
  /usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
       AVCodecContext *codec;
                       ^~~~~
examples/am7xxx-play.c