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 664312 - rtpvorbispay does not handle headers in caps
rtpvorbispay does not handle headers in caps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.30
Other Linux
: Normal normal
: 1.1.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-11-18 02:17 UTC by Aleix Conchillo Flaqué
Modified: 2013-06-28 09:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtpvorbispay now uses headers in buffer caps if not previsouly found (3.75 KB, patch)
2011-11-18 02:20 UTC, Aleix Conchillo Flaqué
none Details | Review
rtpvorbispay: use headers in caps if not previsouly found (4.33 KB, patch)
2012-10-12 00:48 UTC, Aleix Conchillo Flaqué
none Details | Review

Description Aleix Conchillo Flaqué 2011-11-18 02:17:56 UTC
In the same spirit as bug #650406, rtp vorbis payloader suffers from the same, as it seems to always expect header packets before data packets. If a data
packet is received (a no headers are received yet) the following error message
shows up:

0:00:10.451088141 34701       0xc65e90 WARN               rtspmedia rtsp-media.c:1573:default_handle_message: 0xd4da30: got warning Could not decode stream. (gstrtpvorbispay.c(729): gs
Error initializing header config)

The attached patch tries to solve this.
Comment 1 Aleix Conchillo Flaqué 2011-11-18 02:20:15 UTC
Created attachment 201635 [details] [review]
rtpvorbispay now uses headers in buffer caps if not previsouly found
Comment 2 Vincent Penquerc'h 2012-01-23 14:38:46 UTC
I believe the "goto parse_id_failed" being taken can leak a buffer.

The array could also do with a type check for arrayness (as in -base/ext/ogg/gstoggmux.c for instance).
Comment 3 Aleix Conchillo Flaqué 2012-10-12 00:48:22 UTC
Created attachment 226304 [details] [review]
rtpvorbispay: use headers in caps if not previsouly found

It's been a while. Sorry for the long delay.

I have added the array type checking as suggested.

I can't see the buffer leak that you mention. The buffer if "parse_id_failed" (in gst_rtp_vorbis_pay_handle_header_caps) is hit, is obtained from gst_value_get_buffer, and according to the documentation we don't have a reference to it (see below).

I would be really happy to fix the leak if you could give me an extra hint.

Thanks!

-----

#define   gst_value_get_buffer(v)   GST_BUFFER_CAST (g_value_get_boxed(v))

Receives a GstBuffer as the value of v. Does not return a reference to the buffer, so the pointer is only valid for as long as the caller owns a reference to v.
Comment 4 Tim-Philipp Müller 2012-10-12 20:16:44 UTC
Any chance you could make a 1.0 version too?
Comment 5 Aleix Conchillo Flaqué 2012-10-27 00:03:11 UTC
Working on it, just finished coding it but haven't tested it. 

Here's how I tests 0.10 version.

- Output vorbis encoded buffers into a shmksink.

GST_DEBUG=3 gst-launch pulsesrc ! audioconvert ! audioresample ! vorbisenc ! identity ! shmsink socket-path=/tmp/audio-socket wait-for-connection=FALSE -v

- Use gst-rtsp-server example test-launch for the server. As we use shmsrc we need to specify the complete capsfilter (sorry for the long text).

GST_DEBUG=3 ./test-launch "( shmsrc do-timestamp=true socket-path=/tmp/audio-socket is-live=true ! capsfilter caps=\"audio/x-vorbis, streamheader=(buffer)< 01766f72626973000000000144ac0000000000008038010000000000b801, 03766f726269731d000000586970682e4f7267206c6962566f7262697320492032303039303730390000000001, 05766f726269732242435601004000002473182a46a5731684101a425019e31c42ce6bec19424c11821c324c5bcb25739021a4a042885b2881d09055000040000087417814848a41082184253d589283273d082184883978148469410821841042082184104208218445396892832741081d84e330380c83e538f81c8445395810832741e820840f42b89a83ac3908218424354850830639e81c84c22c288a82c430b816840435288c82e430c8d4830b42889a834935f81a846741781684694108218424414890830641c8188446415892830639b81484cb41a81a842a39081f842034641500900000a0a2288aa2280a101ab20a00c8000010405114c7711cc9911cc9b11c0b080d590500000100080000a0488aa4488ee44892245992255992255992e689aa2ccbb22ccbb22ccb32101ab20a0048000050510c45711407080d59050064000008a0388aa5588aa5688ae7888e088486ac0200800000040000103443533c479444cf5455d7b66ddbb66ddbb66ddbb66ddbb66d5b966519080d59050040000010d26966a9068830031906424356010008000080118a30c480d09055000040000080184a0ea209ad39df9ce3a0590e9a4ab1391d9c48b579929b8ab939e79c73cec9e69c31ce39e79ca29c590c9a09ad39e79cc4a0590a9a09ad39e79c27b179d09a2aad39e79c71cee9609c11c639e79c26ad79909a8db539e79c05ad698e9a4bb139e79c48b979529b4bb539e79c73ce39e79c73ce39e79ceac5e91c9c13ce39e79ca8bdb9969bd0c539e79c4fc6e9de9c10ce39e79c73ce39e79c73ce39e79c20346415000004004010868d61dc2908d2e768204611621a32e941f7e830091a839c42ead1e868a4943a08259571524a27080d590500000200400821851452482185145248218514628821861872ca29a7a0824a2aa9a8a28c32cb2cb3cc32cb2cb3cc3aecacb30e3b0c31c410432badc452536d35d6586bee39e79a83b4565a6badb5524a29a594520a42435601002000000442061964905148218514628829a79c720a2aa880d090550000200080000000004ff21cd1111dd1111dd1111dd1111dd1f11ccf112551122551122dd33235d35345557565d7967559b77d5bd8855df77dddf77dddf8756158966559966559966559966559966559962034641500000200002084104248218514524829c61873cc39e8249410080d59050000020008000000701447711cc9911c49b2244bd224cdd22c4ff3344f133d511445d33455d1155d51376d513665d3355d53365d55566d57966d5bb675db9765dbf77ddff77ddff77ddff77ddff77d5d0742435601001200003a92232992222992e3388e24494068c82a004006004000008ae2288ee33892244992256992677996a8999ae9999e2aaa4068c82a00001000400000000000008aa6788aa9788aa8788ee88892689996a8a99a2bcaa6ecbaaeebbaaeebbaaeebbaaeebbaaeebbaaeebbaaeebbaaeebbaaeebbaaeebbaaeebbaae0b8486ac02002400007424477224475224455224477280d0905500800c008000001cc3312445722ccbd2344ff3344f133dd1133dd35345577481d0905500002000800000000000000cc9b014cbd11c4d1225d5522d55532dd55245d5535555555555555555555555555555555555555555555555555555555555555555554dd3344d13080d590900000100d05a73ccad978e41e8ac97c828a4a0d74e39e6a4d7cc28829ce710316398c75231430cc6964184940542435604005100008031c831c41c72ce49ea2445ce392a1da5c63947a9a3d4514ab1a65a3b4aa5b6546be39ca3d451ca28a55a4bab1da5546baab100008000070080000ba1d090150140140000810c520a29859462ce29e79052ca39e61c628a39a79c63ce39289d94ca39279d931229a59c63ce29e79c94ce49e69c93d24928000020c0010020c0422834644500102700e0701c4d93344d14254d13454f145dd71345d59534cd34355154554d144dd5545559164d5596254d334d4d145553134555155553964d55b565cf346dd95455dd1655d5b6655bf67d579675dd334dd91655d5b64d55b5755796755db66ddd9734cd34355154554d1455d75455db3655d5b63551745d51556559545559765d59d75557d67d4d1455d5534dd91555559655d9d5655596755f7455dd565dd9d75559d67ddbd6855fd67dc2a8aaba6ecaaeaeabb2acfbb22efbbaedeb9449d34c53134555d54451554d57b56d53756d5b1345d71555d5964553756555967d5f7565d9d744d175455595655155655995655d776557b74555d56d55767ddf745d5d97755d58665bf785d375755d9565df576559f7655dc7d675dff74cd3b64dd7d575d35575dfd675e5996ddbf84555d5755596855f9565dfd785e1796edd179e515575dd945d5f576559176e5f37dabe6e3caf6d63db3eb2af230c47beb02c5ddb36babe4d9875dde81b43e1378634d3b46dd35575dd745d5f9775dd68ebba5054555d5765d9f75557f67d5bf785e1f67ddf1855d7f755591686d5969d61f77da5ee0b9555b685dfd675e7986d5d587ee3e8fcbe3274755b68ebbab1ccbeae3cbb7174863e020000061c0000024c28038586ac0800e2040018849c434c4188148310424829849052c41884cc39291973524229a98552528b188390392625734e4a28a1a5504a4ba184d64229b185525a6cadd59a5a8b3584d25a28a5b5504a8ba9a51a5b6b35468c41c89c93923927a594d25a28a5b5cc392a9d83943a0829a5945a2c29c558392725838e4a0721a5924a4c25a518432ab19594622c29c5d85a6cb9c5987328a5c5924a6c25a5585b4c39b618738e188390392725734e4a28a5b552526b9573523a0829650e4a2a29c5584a4a31734e4a0721a50e424a25a518534ab18552622b29d5584a6ab1c598734b31d650528b25a5184b4a31b618736eb1e5d641682da412632825c61663aeadb51a4329b19594622c29d51663adbdc598732825c6924a8d25a5585b8db9c618734eb1e59a5aacb9c5d86b6db9f59a73d0a9b55a534cb9b618738eb9055973eebd83d05a28a5c5504a8cadb55a5b8c398752622b29d5584a8ab5c598736bb1f6504a8c25a5584b4a35b6186b8e35f69a5aabb5c5986b6ab1e69a73ef31e6d8536b35b7186b4eb1e55a73eebde6d663010000030e000001269481424356020051000004214a3106a1418831e7a4340831e69c948a31e720a45231e61c845232e720949252e61c8452520aa5a492526ba19452526aad00008002070080001b342516072834642500900a0060701ccbf23c513455d9762cc9f344d13455d5b61dcbf23c51344d55b56dcbf344d13455d57575ddf23c51345555755d5df744513555d5756559f73d51345555755d59f67dd35455d5756559b6855f345557755d599665df585dd5756559b6755b1856d5755d59966d5b37865bd775ddf78561393ab76eebbaeffbc2f13bc70000f0040700a0021b564738291a0b2c34642500900100401883904148218310524821a510524a090000187000000830a10c141ab21200880200000891524a298d94524a29a591524a29a5941242082184104208218410420821841042082184104208218410420821841042080500f84f3800f83fd8a029b13840a1212b0180700000c018a598720c3a0929358c3906a19494526aad618c3108a5a4d45a4b9573104a49a9b5d862ac9c8350524aadc51a630721a5d65aacb1d69a3b0829a5166bac39d81c4a692dc65873cebdf790526b31d65a73efbd97d662ac35e7dc8310c2b41463aeb9f6e07bef29b65a6bcd3df8208450b1d55a73f0410821848b31f7dc83f03d08215c8c39e71e84f0c1076100007783030044828d33ac249d158e06171ab212000809002010628a31e79c8310420891528c39e71c8410422825528a31e79c830e420825648c39e71c84104228a5948c31e79c83104209a5949239e71c84104228a5945232e7a083104209a594524ae71c84104208a594524ae9a083104209a594524a292184104209a594524a292584104209a594524a29a584104a28a594524a29a594104229a594524a29a594124228a594524a29a594924229a594524a29a594525228a594524a29a594524a09a594524a29a5949452490500001c3800000418412719551661a309171e80424356020040000014c45653899d41cc3167a9210831a8a9424a29863143ca20a629530a218521738a2102a1c5564bc5000000100400080809003040503003000c0e103e0741274070b401000842648648342c048707950011311500242628e4024085c545dac5057419e0822eee3a1042108210c4e2000a48c0c109373cf18627dce0049da2520701000000007000000f0000c7051011d11c4686c6064787c70748480000000000c800c00700c021024444348791a1b1c1d1e1f10112120000000000000000000404040000000000020000000404 >\" ! rtpvorbispay name=pay0 pt=96 )"

- Finally, connect:

gst-launch rtspsrc location=rtsp://127.0.0.1:8554/test ! fakesink -v

Without the patch we see this error:

0:00:04.969821739  5564      0x1075730 WARN            rtpvorbispay gstrtpvorbispay.c:641:gst_rtp_vorbis_pay_handle_buffer:<pay0> warning: Error initializing header config
0:00:04.969863647  5564      0x1075730 INFO        GST_ERROR_SYSTEM gstelement.c:1931:gst_element_message_full:<pay0> posting message: Could not decode stream.
0:00:04.969892328  5564      0x1075730 INFO        GST_ERROR_SYSTEM gstelement.c:1954:gst_element_message_full:<pay0> posted warning message: Could not decode stream.
0:00:04.969937555  5564      0x101e760 WARN               rtspmedia rtsp-media.c:1586:default_handle_message: 0xebd260: got warning Could not decode stream. (gstrtpvorbispay.c(641): gst_rtp_vorbis_pay_handle_buffer (): /GstPipeline:media-pipeline/GstBin:bin0/GstRtpVorbisPay:pay0:
Error initializing header config)
Comment 6 Wim Taymans 2013-06-28 09:44:52 UTC
I rearranged it a little in 1.0:

commit 6c716dfc25c8c365925578bea3149282448cc1b8
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Fri Jun 28 11:43:17 2013 +0200

    vorbispay: handle streamheader as well
    
    Take config strings from the streamheader when we can
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=664312