[MPlayer-dev-eng] UPDATED: A RTSP/ RTP streaming patch for "mplayer"

Arpi arpi at thot.banki.hu
Mon Aug 5 02:47:59 CEST 2002


Hi,

> I would very much like to see this patch included in the official mplayer 
> sources.  Please let me know if this can be done.

ok it's in the official mplayer now :)
anyway i had to do 3 changes in your patch:

1. i've disabled live.com libs by default in ./configure, as your
   way of detection live libs is not strict enough - ie it only
   checks for the directory, not for teh files there nor the
   correct version number. imagine users with empty live/ dirs
   or having other project's files (possible - the word "live" is not
   copyrighted...) or just too old version of your lib, making the
   whole mplayer compile process to break.
   i've also changed it a bit, so it always find the dir if not
   specified, so its' enough to do --enable-live if the libs are
   in 'path'

2. in network.c imho you made a typo, maybe even worse:

+#ifdef STREAMING_LIVE_DOT_COM
+       // Old, hacked RTP support, which works for MPEG Transport Streams
+       //   RTP streams only:
                // Checking for RTP
                if( !strcasecmp(url->protocol, "rtp") ) {
                        if( url->port==0 ) {
@@ -466,6 +478,7 @@
                        }
                        return 0;
                }
+#endif

- the old RTP support is for mpeg 1/2 _program_ streams
- the #ifdef above should be #ifndef imho - at least this code should be
  compiled if no live.com is used

btw, now rtp:// is disabled if live.com is enabled - if your lib supports
rtp:// then it should really work, now it isn't accepted.
so, either left rtp:// code enabled, or implement rtp:// too using live.com

3. at video.c:

@@ -208,10 +215,18 @@
     float pts1=d_video->pts;
 //    unsigned char* start=NULL;
     int in_size=0;
+    int isMPEG;

     *start=NULL;

-  if(demuxer->file_format==DEMUXER_TYPE_MPEG_ES ||
demuxer->file_format==DEMUXE+#ifdef STREAMING_LIVE_DOT_COM
+    if (demuxer->file_format==DEMUXER_TYPE_RTP) {
+      isMPEG = demux_is_mpeg_rtp_stream(demuxer);
+    } else
+#endif
+    isMPEG = demuxer->file_format==DEMUXER_TYPE_MPEG_ES
+      || demuxer->file_format==DEMUXER_TYPE_MPEG_PS;
+    if (isMPEG) {
         int in_frame=0;
         //float newfps;
         //videobuf_len=0;

this will overwrite the result of the live.com check above:

+    isMPEG = demuxer->file_format==DEMUXER_TYPE_MPEG_ES
+      || demuxer->file_format==DEMUXER_TYPE_MPEG_PS;

i've fixed this one


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list