Merge commit '972c71e9cb63e24f57ee481e413199c7d88a8813'
authorJames Almer <jamrial@gmail.com>
Sun, 23 Apr 2017 01:35:27 +0000 (22:35 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 23 Apr 2017 01:35:27 +0000 (22:35 -0300)
* commit '972c71e9cb63e24f57ee481e413199c7d88a8813':
  lavc: add support for filtering packets before decoding

Merged-by: James Almer <jamrial@gmail.com>
1  2 
configure
libavcodec/avcodec.h
libavcodec/decode.c
libavcodec/decode.h
libavcodec/internal.h
libavcodec/utils.c

diff --cc configure
Simple merge
@@@ -3790,12 -3243,14 +3790,18 @@@ typedef struct AVCodec 
       * See FF_CODEC_CAP_* in internal.h
       */
      int caps_internal;
+     /**
+      * Decoding only, a comma-separated list of bitstream filters to apply to
+      * packets before decoding.
+      */
+     const char *bsfs;
  } AVCodec;
  
 +int av_codec_get_max_lowres(const AVCodec *codec);
 +
 +struct MpegEncContext;
 +
  /**
   * @defgroup lavc_hwaccel AVHWAccel
   * @{
@@@ -525,15 -424,12 +636,15 @@@ int attribute_align_arg avcodec_send_pa
      if (avctx->internal->draining)
          return AVERROR_EOF;
  
-     if (avci->buffer_pkt->data || avci->buffer_pkt->side_data_elems)
-         return AVERROR(EAGAIN);
 +    if (avpkt && !avpkt->size && avpkt->data)
 +        return AVERROR(EINVAL);
 +
-     if (!avpkt || !avpkt->size) {
-         avctx->internal->draining = 1;
-     } else {
+     ret = bsfs_init(avctx);
+     if (ret < 0)
+         return ret;
+     av_packet_unref(avci->buffer_pkt);
+     if (avpkt && (avpkt->data || avpkt->side_data_elems)) {
          ret = av_packet_ref(avci->buffer_pkt, avpkt);
          if (ret < 0)
              return ret;
@@@ -1546,9 -1084,8 +1672,11 @@@ void avcodec_flush_buffers(AVCodecConte
      else if (avctx->codec->flush)
          avctx->codec->flush(avctx);
  
 +    avctx->pts_correction_last_pts =
 +    avctx->pts_correction_last_dts = INT64_MIN;
 +
+     ff_decode_bsfs_uninit(avctx);
      if (!avctx->refcounted_frames)
          av_frame_unref(avctx->internal->to_free);
  }
Simple merge
Simple merge
@@@ -42,8 -39,8 +42,9 @@@
  #include "libavutil/imgutils.h"
  #include "libavutil/samplefmt.h"
  #include "libavutil/dict.h"
 +#include "libavutil/thread.h"
  #include "avcodec.h"
+ #include "decode.h"
  #include "libavutil/opt.h"
  #include "me_cmp.h"
  #include "mpegvideo.h"