[4/5] movenc: write correct format hvcc when tag is hvc1

Message ID 20170619150209.27009-4-stebbins@jetheaddev.com
State New
Headers show

Commit Message

John Stebbins June 19, 2017, 3:02 p.m.
---
 libavformat/movenc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Martin Storsjö June 20, 2017, 6:05 a.m. | #1
On Mon, 19 Jun 2017, John Stebbins wrote:

> ---
> libavformat/movenc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 805d928..5b5082d 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -727,7 +727,10 @@ static int mov_write_hvcc_tag(AVIOContext *pb, MOVTrack *track)
>
>     avio_wb32(pb, 0);
>     ffio_wfourcc(pb, "hvcC");
> -    ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 0);
> +    if (track->tag == MKTAG('h','v','c','1'))
> +        ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 1);
> +    else
> +        ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 0);
>     return update_size(pb, pos);
> }
> 
> -- 
> 2.9.4

Ok

// Martin

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 805d928..5b5082d 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -727,7 +727,10 @@  static int mov_write_hvcc_tag(AVIOContext *pb, MOVTrack *track)
 
     avio_wb32(pb, 0);
     ffio_wfourcc(pb, "hvcC");
-    ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 0);
+    if (track->tag == MKTAG('h','v','c','1'))
+        ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 1);
+    else
+        ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 0);
     return update_size(pb, pos);
 }