Guest User

some_help.cpp

a guest
May 14th, 2018
73
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static int our_get_buffer(struct AVCodecContext *c, AVFrame *pic)
  2. {
  3.     int ret = avcodec_default_get_buffer(c, pic);
  4.     int64_t *pts = (int64_t*)av_malloc(sizeof(int64_t));
  5.     *pts = global_video_pkt_pts;
  6.     pic->opaque = pts;
  7.     return ret;
  8. }
  9. static void our_release_buffer(struct AVCodecContext *c, AVFrame *pic)
  10. {
  11.     if(pic) av_freep(&pic->opaque);
  12.     avcodec_default_release_buffer(c, pic);
  13. }
  14. static int our_get_buffer(struct AVCodecContext *c, AVFrame *pic)
  15. {
  16.     int ret = avcodec_default_get_buffer(c, pic);
  17.     int64_t *pts = (int64_t*)av_malloc(sizeof(int64_t));
  18.     *pts = global_video_pkt_pts;
  19.     pic->opaque = pts;
  20.     return ret;
  21. }
  22. static void our_release_buffer(struct AVCodecContext *c, AVFrame *pic)
  23. {
  24.     if(pic) av_freep(&pic->opaque);
  25.     avcodec_default_release_buffer(c, pic);
  26. }
RAW Paste Data