Guest User

Untitled

a guest
Oct 17th, 2019
18
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
  2. index 8aa248e6cd..70837cf9c8 100644
  3. --- a/libavcodec/libdav1d.c
  4. +++ b/libavcodec/libdav1d.c
  5. @@ -179,6 +179,8 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
  6.              return res;
  7.  
  8.          if (pkt.size) {
  9. +            AVBufferRef *reordered_opaque;
  10. +
  11.              res = dav1d_data_wrap(data, pkt.data, pkt.size, libdav1d_data_free, pkt.buf);
  12.              if (res < 0) {
  13.                  av_packet_unref(&pkt);
  14. @@ -191,6 +193,21 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
  15.  
  16.              pkt.buf = NULL;
  17.              av_packet_unref(&pkt);
  18. +
  19. +            reordered_opaque = av_buffer_alloc(sizeof(c->reordered_opaque));
  20. +                       if (!reordered_opaque) {
  21. +                dav1d_data_unref(data);
  22. +                return AVERROR(ENOMEM);
  23. +            }
  24. +
  25. +            *reordered_opaque->data = c->reordered_opaque;
  26. +            res = dav1d_data_wrap_user_data(data, reordered_opaque->data,
  27. +                                            libdav1d_data_free, reordered_opaque);
  28. +            if (res < 0) {
  29. +                av_buffer_unref(&reordered_opaque);
  30. +                dav1d_data_unref(data);
  31. +                return res;
  32. +            }
  33.          }
  34.      }
  35.  
  36. @@ -260,7 +277,7 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
  37.      else
  38.          frame->format = c->pix_fmt = pix_fmt[p->p.layout][p->seq_hdr->hbd];
  39.  
  40. -    frame->reordered_opaque = c->reordered_opaque;
  41. +    frame->reordered_opaque = (int64_t)*p->m.user_data.data;
  42.  
  43.      // match timestamps and packet size
  44.      frame->pts = frame->best_effort_timestamp = p->m.timestamp;
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×