media.cpp: uncommented code

PG
Piewald Georg
Fri, Sep 16, 2016 1:07 PM

Hi,
After investigating a problem in my software, I discovered that in media.cpp line 1590, ConfPortInfo::fromPj() there is some commented-out code. However, this code is necessary, otherwise some object members are not initialized. There is no reason given why it is uncommented. Is it simply a bug?
Best regards,
Georg

Hi, After investigating a problem in my software, I discovered that in media.cpp line 1590, ConfPortInfo::fromPj() there is some commented-out code. However, this code is necessary, otherwise some object members are not initialized. There is no reason given why it is uncommented. Is it simply a bug? Best regards, Georg
M
Ming
Fri, Sep 16, 2016 1:57 PM

Hi Georg,

Not sure which you're referring to, line 1590 is the end of the file.
If you're referring to this:
https://trac.pjsip.org/repos/browser/pjproject/trunk/pjsip/src/pjsua2/media.cpp#L82

Then it looks correct, since format field will be populated by the code
"format.fromPj(port_info.format);"

Regards,
Ming

On Fri, Sep 16, 2016 at 9:07 AM, Piewald Georg gpi@mission-embedded.com
wrote:

Hi,

After investigating a problem in my software, I discovered that in
media.cpp line 1590, ConfPortInfo::fromPj() there is some commented-out
code. However, this code is necessary, otherwise some object members are
not initialized. There is no reason given why it is uncommented. Is it
simply a bug?

Best regards,

Georg


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi Georg, Not sure which you're referring to, line 1590 is the end of the file. If you're referring to this: https://trac.pjsip.org/repos/browser/pjproject/trunk/pjsip/src/pjsua2/media.cpp#L82 Then it looks correct, since format field will be populated by the code "format.fromPj(port_info.format);" Regards, Ming On Fri, Sep 16, 2016 at 9:07 AM, Piewald Georg <gpi@mission-embedded.com> wrote: > Hi, > > After investigating a problem in my software, I discovered that in > media.cpp line 1590, ConfPortInfo::fromPj() there is some commented-out > code. However, this code is necessary, otherwise some object members are > not initialized. There is no reason given why it is uncommented. Is it > simply a bug? > > Best regards, > > Georg > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >
PG
Piewald Georg
Fri, Sep 16, 2016 5:54 PM

Hi Ming!

Ah, I overlooked that... So the problem in my case was that format.type was set to PJMEDIA_TYPE_UNKNOWN, and hence the members of the object didn’t get initialized. (I’m still confused why it’s set to unknown, because it is the automatically generated audio media object for the default sound card, which IMHO should be set to PJMEDIA_TYPE_AUDIO, but anyway – I’ll bother with that later).

Thanks for your answer!
Georg

PS: isn’t commented-out code considered bad style?
PPS: sorry for the line number – I don’t know where I was looking

From: pjsip [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of Ming
Sent: Friday, September 16, 2016 15:58
To: pjsip list pjsip@lists.pjsip.org
Subject: Re: [pjsip] media.cpp: uncommented code

Hi Georg,

Not sure which you're referring to, line 1590 is the end of the file.
If you're referring to this:
https://trac.pjsip.org/repos/browser/pjproject/trunk/pjsip/src/pjsua2/media.cpp#L82

Then it looks correct, since format field will be populated by the code
"format.fromPj(port_info.format);"

Regards,
Ming

On Fri, Sep 16, 2016 at 9:07 AM, Piewald Georg <gpi@mission-embedded.commailto:gpi@mission-embedded.com> wrote:
Hi,
After investigating a problem in my software, I discovered that in media.cpp line 1590, ConfPortInfo::fromPj() there is some commented-out code. However, this code is necessary, otherwise some object members are not initialized. There is no reason given why it is uncommented. Is it simply a bug?
Best regards,
Georg


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.orgmailto:pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi Ming! Ah, I overlooked that... So the problem in my case was that format.type was set to PJMEDIA_TYPE_UNKNOWN, and hence the members of the object didn’t get initialized. (I’m still confused why it’s set to unknown, because it is the automatically generated audio media object for the default sound card, which IMHO should be set to PJMEDIA_TYPE_AUDIO, but anyway – I’ll bother with that later). Thanks for your answer! Georg PS: isn’t commented-out code considered bad style? PPS: sorry for the line number – I don’t know where I was looking From: pjsip [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of Ming Sent: Friday, September 16, 2016 15:58 To: pjsip list <pjsip@lists.pjsip.org> Subject: Re: [pjsip] media.cpp: uncommented code Hi Georg, Not sure which you're referring to, line 1590 is the end of the file. If you're referring to this: https://trac.pjsip.org/repos/browser/pjproject/trunk/pjsip/src/pjsua2/media.cpp#L82 Then it looks correct, since format field will be populated by the code "format.fromPj(port_info.format);" Regards, Ming On Fri, Sep 16, 2016 at 9:07 AM, Piewald Georg <gpi@mission-embedded.com<mailto:gpi@mission-embedded.com>> wrote: Hi, After investigating a problem in my software, I discovered that in media.cpp line 1590, ConfPortInfo::fromPj() there is some commented-out code. However, this code is necessary, otherwise some object members are not initialized. There is no reason given why it is uncommented. Is it simply a bug? Best regards, Georg _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org<mailto:pjsip@lists.pjsip.org> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org