Merge commit 'c7ab0eb3050acdd3b8cab2c55fc9c1b2e8610a65'
authorJames Almer <jamrial@gmail.com>
Tue, 4 Apr 2017 17:47:09 +0000 (14:47 -0300)
committerJames Almer <jamrial@gmail.com>
Tue, 4 Apr 2017 17:47:09 +0000 (14:47 -0300)
* commit 'c7ab0eb3050acdd3b8cab2c55fc9c1b2e8610a65':
  examples/decode_video: allocate the packet dynamically

Merged-by: James Almer <jamrial@gmail.com>
1  2 
doc/examples/decode_video.c

@@@ -167,19 -162,20 +169,20 @@@ int main(int argc, char **argv
              data      += ret;
              data_size -= ret;
  
-             if (avpkt.size)
-                 decode(c, frame, &avpkt, outfilename);
-          }
-      }
+             if (pkt->size)
 -                decode(c, picture, pkt, outfilename);
++                decode(c, frame, pkt, outfilename);
+         }
+     }
  
      /* flush the decoder */
 -    decode(c, picture, NULL, outfilename);
 +    decode(c, frame, NULL, outfilename);
  
      fclose(f);
  
      av_parser_close(parser);
      avcodec_free_context(&c);
 -    av_frame_free(&picture);
 +    av_frame_free(&frame);
+     av_packet_free(&pkt);
  
      return 0;
  }