Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7188 closed defect (fixed)

webm_chunk muxer is broken since commit 18ac64235939c4c5c7656546a9545f68339affbe

Reported by: octop Owned by: Marton Balint
Priority: important Component: avformat
Version: git-master Keywords: webm regression
Cc: Marton Balint Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

The commit 18ac64235939c4c5c7656546a9545f68339affbe introduced a regression, making the webm_chunk muxer cease to function properly.

libavformat/webm_chunk.c
@@ -127,12 +127,12 @@ static int webm_chunk_write_header(AVFormatContext *s)
     if (ret < 0)
         return ret;
     oc = wc->avf;
-    ret = get_chunk_filename(s, 1, oc->filename);
+    ret = get_chunk_filename(s, 1, oc->url);
     if (ret < 0)
         return ret;
     if (wc->http_method)
         av_dict_set(&options, "method", wc->http_method, 0);
-    ret = s->io_open(s, &oc->pb, oc->filename, AVIO_FLAG_WRITE, &options);
+    ret = s->io_open(s, &oc->pb, oc->url, AVIO_FLAG_WRITE, &options);
     av_dict_free(&options);
     if (ret < 0)
         return ret;

In my own testing, I discovered that oc->url in that code evaluates to null, making the muxer return prematurely.

To reproduce:
ffmpeg -re -f lavfi -i sine -map 0 -strict -2 -c:a opus -f webm_chunk -header webm_live_sine.hdr webm_live_sine_%d.chk

Attachments (1)

webm-url-fix.patch (1.0 KB ) - added by Marton Balint 6 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by octop, 6 years ago

Keywords: regression added

by Marton Balint, 6 years ago

Attachment: webm-url-fix.patch added

comment:2 by Marton Balint, 6 years ago

Cc: Marton Balint added
Owner: set to Marton Balint
Status: newopen

Could you try the attached patch?

in reply to:  2 comment:3 by octop, 6 years ago

The muxer works again after applying your patch, thank you. So the issue was caused by trying to "dynamically" create the nonexistent url field in that AVFormatContext *oc structure?

comment:4 by Marton Balint, 6 years ago

Yeah, the URL field (which is a replacement for the deprecated filename field) must be dynamically allocated, so it cannot be used as a static (fixed-length) buffer. I will send this patch to ffmpeg-devel and apply and backport it in a few days.

comment:5 by Marton Balint, 6 years ago

Resolution: fixed
Status: openclosed

comment:6 by Carl Eugen Hoyos, 6 years ago

Keywords: webm added
Note: See TracTickets for help on using tickets.