After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 746682 - flvdemux: Don't create AAC/H264 caps without codec_data
flvdemux: Don't create AAC/H264 caps without codec_data
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-24 11:47 UTC by Sebastian Dröge (slomo)
Modified: 2015-03-24 15:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
flvdemux: Don't create AAC/H264 caps without codec_data (6.31 KB, patch)
2015-03-24 11:47 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2015-03-24 11:47:35 UTC
See commit message
Comment 1 Sebastian Dröge (slomo) 2015-03-24 11:47:39 UTC
Created attachment 300192 [details] [review]
flvdemux: Don't create AAC/H264 caps without codec_data

Instead delay creating the caps until we read the codec_data from the stream,
or fail if we get normal data before the codec_data.

AAC raw caps and H264 avc caps always need codec_data, setting caps on the pad
without them is going to make negotiation fail most of the time. Even if we
later set new caps with the codec_data, that's usually going to be too late.
Comment 2 Nicolas Dufresne (ndufresne) 2015-03-24 13:00:56 UTC
Review of attachment 300192 [details] [review]:

::: gst/flv/gstflvdemux.c
@@ +714,1 @@
+      gst_buffer_map (demux->audio_codec_data, &map, GST_MAP_READ);

Check the return value while at it please.

@@ +932,3 @@
 
+  if G_UNLIKELY
+    (!demux->audio_pad && demux->no_more_pads) {

This is a weird syntax, I didn't know it was valid. Remains that his change does not belong here.

@@ +1116,3 @@
+          GST_ERROR_OBJECT (demux, "got AAC audio packet before codec data");
+          ret = GST_FLOW_ERROR;
+          goto beach;

Is that an error without posting on the bus ? Or is this only failing audio ? Maybe posting at least a warning on the bus would be nice ?
Comment 3 Sebastian Dröge (slomo) 2015-03-24 13:26:36 UTC
I'll push the gst-indent noise as a separate commit, and post an error message in those two cases. First of all someone needs to check that this patch actually fixes something, I only implemented that based on a bug report on IRC and don't have a sample stream :)
Comment 4 Sebastian Dröge (slomo) 2015-03-24 15:20:29 UTC
It's not an error anymore and we just ignore packets before we have codec_data.

commit ac0141b6a0dbb30372d11501b413a61b06da8d38
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Tue Mar 24 16:18:53 2015 +0100

    flvdemux: Only set caps once if they don't change
    
    Previously we were setting new caps with the same content for every H264 or
    AAC codec_data we found in the stream, spamming everything and causing
    renegotiations.

commit c9b42951fefaeb4afbad2f84ff845375424f8bcb
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Tue Mar 24 12:46:19 2015 +0100

    flvdemux: Don't create AAC/H264 caps without codec_data
    
    Instead delay creating the caps until we read the codec_data from the stream,
    or fail if we get normal data before the codec_data.
    
    AAC raw caps and H264 avc caps always need codec_data, setting caps on the pad
    without them is going to make negotiation fail most of the time. Even if we
    later set new caps with the codec_data, that's usually going to be too late.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746682

commit 5e88b532122bab23227a010b1ca9790c595fd780
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Tue Mar 24 15:39:22 2015 +0100

    flvdemux: Fix indention