patch for pjmedia/src/pjmedia/conference.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jens,

thanks for the feedback, and sorry for the delay in getting back to you.

For the solution to your requirement, you should destroy the player
(pjsua_player_destroy()) in your callback, and return non-PJ_SUCCESS.
And that's the convention that we use now. I know that the
documentation probably should say that more clearly. Now it says:

"If the callback returns non-PJ_SUCCESS, the playback will stop."

But this is not wrong either, as that was meant for looping playback.
It's true that with PJSUA-LIB, the playback doesn't stop even when
both NO_LOOP and returning non-PJ_SUCCESS to the callback are used,
causing the callback to get called repeatedly. This is because the
player is still connected in the bridge. While the player itself has
stopped the playback, the bridge is still trying to get frames from
the player, hence repeteadly triggering the EOF callback. Neither of
them are wrong here, IMO, they're just doing what the app tells them
to do (or rather doesn't tell them what to do). You need to remember
that file player doesn't know anything about the conf bridge, so in
this context, the player documentation and the behavior in general
still holds true, i.e. if you try to get frame from an EOF-ed player,
your EOF callback will be called.

I did remove the auto-disabling feature in the bridge when get_frame()
returns non-PJ_SUCCESS. I can't remember exactly why it was, but I
think I'm more inclined to leave that as it is for now, since it looks
okay that way, and there's a way to get around that (as above).

Cheers
 Benny


On Tue, Oct 6, 2009 at 11:22 AM, Jens Jorgensen <jbj1 at ultraemail.net> wrote:
> Hello,
>
> I posted this patch on Sep 17 but my post got no reply at the patch
> wasn't applied so I'm taking another crack at it. Back at r426 there was
> code in pjmedia/src/pjmedia/conference.c that would disable a port if
> get_frame did not return PJ_SUCCESS. I'm sure this was for some good
> reason. However, this change disabled the functionality for a wav file
> where you get a callback when the wav file is finished playing. I've
> created a patch that only disables the port if the return value is
> PJ_EEOF, which brings back the callback functionality. I hope you'll
> apply my patch to the source. Or if there's something you don't like
> about the patch, maybe you can tell me about that and I can try to come
> up with a different fix.
>
> Thanks,
>
> --
> Jens B. Jorgensen
> jbj1 at ultraemail.net
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux