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 735520 - aacparse: skip valid ADTS/LOAS frames
aacparse: skip valid ADTS/LOAS frames
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.4.0
Other Linux
: Normal normal
: 1.4.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-27 13:50 UTC by Nicolas Huet
Modified: 2014-09-04 09:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix skip frame issue (2.18 KB, patch)
2014-08-27 13:51 UTC, Nicolas Huet
none Details | Review
fix parsing ADTS/LOAS issue (2.55 KB, patch)
2014-09-01 08:02 UTC, Nicolas Huet
committed Details | Review
aac stream (218.00 KB, application/octet-stream)
2014-09-01 12:15 UTC, Nicolas Huet
  Details

Description Nicolas Huet 2014-08-27 13:50:05 UTC
When parsing an incomplete ADTS/LOAS frame, the first byte of this frame is skipped which make the frame invalid.

In the function gst_aac_parse_handle_frame, if gst_aac_parse_check_adts_frame returns FALSE with needed data > 0, skipsize remains -1. If skipsize == -1, skipsize becomes 1 to skip the first byte (still needed).

See the attached patch that fix the issue.
Comment 1 Nicolas Huet 2014-08-27 13:51:07 UTC
Created attachment 284602 [details] [review]
fix skip frame issue
Comment 2 Sebastian Dröge (slomo) 2014-08-27 14:12:40 UTC
Can you provide a sample stream that shows this behaviour? And also please attach the patch in "git format-patch" format, including a descriptive commit message and having your name and mail address set up in the git config :)
Comment 3 Nicolas Huet 2014-08-28 13:22:33 UTC
I do not wish to publish the stream (72 MB). I can sent it to you directly.
I will provide a new patch.
Comment 4 Sebastian Dröge (slomo) 2014-08-29 08:30:49 UTC
Just attaching the relevant part of the file should also be enough already. And please convert the patch to "git format-patch" format.
Comment 5 Nicolas Huet 2014-09-01 08:02:17 UTC
Created attachment 284981 [details] [review]
fix parsing ADTS/LOAS issue
Comment 6 Nicolas Huet 2014-09-01 08:05:37 UTC
I tried to dump the AAC stream only. But with this dump, I am unable to reproduced the issue.
I manage to reproduce with the full .TS file only.
Comment 7 Tim-Philipp Müller 2014-09-01 11:28:02 UTC
Could you attach the first 1MB of the .ts file then perhaps? (assuming it reproduces the issue)

Or you could try do do  ... ! tsdemux ! audio/mpeg ! gdppay ! filesink location=aac.gdp
Comment 8 Nicolas Huet 2014-09-01 12:15:20 UTC
Created attachment 284996 [details]
aac stream
Comment 9 Nicolas Huet 2014-09-01 12:16:05 UTC
Thanks very much Tim. I did not know gdp.

To use this stream, you will need also to have the patch included in https://bugzilla.gnome.org/show_bug.cgi?id=721697

gst-launch-1.0 -v --gst-debug=aacparse:6 filesrc location= aac.gdp  ! gdpdepay ! aacparse  ! fakesink silent=false

Running without the patch (the first 3 discont are expected):

/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (266 bytes, dts: 0:00:00.420391444, pts: 0:00:00.420391444, duration: 0:00:00.042666666, offset: 250, offset_end: -1, flags: 00000040 discont ) 0x75e05aa8
...
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (262 bytes, dts: 0:00:02.639058111, pts: 0:00:02.724391443, duration: 0:00:00.042666666, offset: 14290, offset_end: -1, flags: 00000040 discont ) 0x75e05dc8
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (258 bytes, dts: 0:00:03.682009184, pts: 0:00:03.682009184, duration: 0:00:00.042666666, offset: 14586, offset_end: -1, flags: 00000040 discont ) 0x75e05aa8
...
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (238 bytes, dts: 0:00:15.202009184, pts: 0:00:15.202009184, duration: 0:00:00.042666666, offset: 83752, offset_end: -1, flags: 00000040 discont ) 0x75e05a08
...
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (248 bytes, dts: 0:00:17.463342517, pts: 0:00:17.463342517, duration: 0:00:00.042666666, offset: 97456, offset_end: -1, flags: 00000040 discont ) 0x75e058c8
...
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (264 bytes, dts: 0:00:31.756675851, pts: 0:00:31.756675851, duration: 0:00:00.042666666, offset: 183164, offset_end: -1, flags: 00000040 discont ) 0x75e05dc8



Running it with the patch:

/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (266 bytes, dts: 0:00:00.420391444, pts: 0:00:00.420391444, duration: 0:00:00.042666666, offset: 250, offset_end: -1, flags: 00000040 discont ) 0x756062b8
...
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (262 bytes, dts: 0:00:02.639058111, pts: 0:00:02.724391443, duration: 0:00:00.042666666, offset: 14290, offset_end: -1, flags: 00000040 discont ) 0x756065d8
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (258 bytes, dts: 0:00:03.682009184, pts: 0:00:03.682009184, duration: 0:00:00.042666666, offset: 14586, offset_end: -1, flags: 00000040 discont ) 0x756062b8
Comment 10 Sebastian Dröge (slomo) 2014-09-02 06:43:43 UTC
commit 15894c1853bd26147a7608d3b0a85d9f3015494c
Author: Nicolas Huet <nicolas.huet@parrot.com>
Date:   Mon Sep 1 09:56:02 2014 +0200

    aacparse: Fix parsing issue when the buffer does not have a complete ADTS/LOAS frame
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735520