[FFmpeg-devel,v2,1/2] cbs_av1: Fix header writing when already aligned

Submitted by Mark Thompson on Nov. 5, 2018, 3:25 p.m.

Details

Message ID 20181105152526.16457-1-sw@jkqxz.net
State New
Headers show

Commit Message

Mark Thompson Nov. 5, 2018, 3:25 p.m.
---
 libavcodec/cbs_av1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Almer Nov. 5, 2018, 9:25 p.m.
On 11/5/2018 12:25 PM, Mark Thompson wrote:
> ---
>  libavcodec/cbs_av1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
> index 9bac9dde09..1c49d90f51 100644
> --- a/libavcodec/cbs_av1.c
> +++ b/libavcodec/cbs_av1.c
> @@ -1179,7 +1179,7 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx,
>          if (err < 0)
>              return err;
>          end_pos = put_bits_count(pbc);
> -        obu->obu_size = (end_pos - start_pos + 7) / 8;
> +        obu->obu_size = header_size = (end_pos - start_pos + 7) / 8;
>      } else {
>          // Empty OBU.
>          obu->obu_size = 0;

Still LGTM.

Patch hide | download patch | download mbox

diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
index 9bac9dde09..1c49d90f51 100644
--- a/libavcodec/cbs_av1.c
+++ b/libavcodec/cbs_av1.c
@@ -1179,7 +1179,7 @@  static int cbs_av1_write_obu(CodedBitstreamContext *ctx,
         if (err < 0)
             return err;
         end_pos = put_bits_count(pbc);
-        obu->obu_size = (end_pos - start_pos + 7) / 8;
+        obu->obu_size = header_size = (end_pos - start_pos + 7) / 8;
     } else {
         // Empty OBU.
         obu->obu_size = 0;