[FFmpeg-devel] lavf/movenc: keep eac3_priv around; fixes eac3 in DASH

Submitted by Rodger Combs on March 8, 2018, 5:10 a.m.

Details

Message ID 20180308051034.12241-1-rodger.combs@gmail.com
State New
Headers show

Commit Message

Rodger Combs March 8, 2018, 5:10 a.m.
---
 libavformat/movenc.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Derek Buitenhuis March 8, 2018, 11:46 a.m.
On 3/8/2018 5:10 AM, Rodger Combs wrote:
> ---
>  libavformat/movenc.c | 1 -
>  1 file changed, 1 deletion(-)

Er, how/why?

No info is provided in this commit message.

- Derek
Rodger Combs March 9, 2018, 2:42 a.m.
Muxing DASH may involve calling mov_write_eac3_tag multiple times on the same stream. If we destroy eac3_priv after the first call, we don't have it  later, so we end up not writing that data. This is fine for lavf (since everything in that atom is redundant), but some other players require it.

> On Mar 8, 2018, at 05:46, Derek Buitenhuis <derek.buitenhuis@gmail.com> wrote:
> 
> On 3/8/2018 5:10 AM, Rodger Combs wrote:
>> ---
>> libavformat/movenc.c | 1 -
>> 1 file changed, 1 deletion(-)
> 
> Er, how/why?
> 
> No info is provided in this commit message.
> 
> - Derek
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Derek Buitenhuis March 9, 2018, 3:10 p.m.
On 3/9/2018 2:42 AM, Rodger Combs wrote:
> Muxing DASH may involve calling mov_write_eac3_tag multiple times on the same stream. If we destroy eac3_priv after the first call, we don't have it  later, so we end up not writing that data. This is fine for lavf (since everything in that atom is redundant), but some other players require it.

So add that to the commit message and also make it clear
no mem leak is introduced.

- Derek

Patch hide | download patch | download mbox

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 5b1e66c897..fb8462ed9a 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -554,7 +554,6 @@  static int mov_write_eac3_tag(AVIOContext *pb, MOVTrack *track)
 
 end:
     av_packet_unref(&info->pkt);
-    av_freep(&track->eac3_priv);
 
     return size;
 }