History

don't flush on every audio/video packet

Sigrid Solveig Haflínudóttir committed 5 years ago

Commit 1471e461 parent daf4e541 file · +12 −12Browse files

Unified · Split

rtmp.c+12−12
@@ -324,7 +324,7 @@ err: · 323 unmodified lines
324}324}
325 325
326static int326static int
327rtmpsend(RTMP *r)327rtmpsend(RTMP *r, int flush)
328{328{
329 u8int *p, *h, *e, hdata[24];329 u8int *p, *h, *e, hdata[24];
330 int len, n, hsz;330 int len, n, hsz;
@@ -368,7 +368,7 @@ rtmpsend(RTMP *r) · 37 unmodified lines
368 }368 }
369 }369 }
370 370
371 if(Bflush(r) < 0)371 if(flush && Bflush(r) < 0)
372 goto err;372 goto err;
373 373
374 if(debug){374 if(debug){
@@ -412,7 +412,7 @@ pong(RTMP *r, s32int n) · 37 unmodified lines
412 puti16(CtlPingResponse);412 puti16(CtlPingResponse);
413 puti32(n);413 puti32(n);
414 414
415 return rtmpsend(r);415 return rtmpsend(r, 1);
416}416}
417 417
418static int418static int
@@ -422,7 +422,7 @@ setchunksz(RTMP *r, int sz) · 3 unmodified lines
422 422
423 newmsg(r, SetChunkSize, Type0, CSUserCtl);423 newmsg(r, SetChunkSize, Type0, CSUserCtl);
424 puti32(sz);424 puti32(sz);
425 n = rtmpsend(r);425 n = rtmpsend(r, 1);
426 r->chunkout = sz;426 r->chunkout = sz;
427 427
428 return n;428 return n;
@@ -676,7 +676,7 @@ rtmpstream(RTMP *r, ulong *sid) · 247 unmodified lines
676 676
677 r->o.msg.cmd.cb = streamcreated;677 r->o.msg.cmd.cb = streamcreated;
678 r->o.msg.cmd.aux = c;678 r->o.msg.cmd.aux = c;
679 n = rtmpsend(r);679 n = rtmpsend(r, 1);
680 680
681 qunlock(r);681 qunlock(r);
682 682
@@ -732,7 +732,7 @@ rtmppublish(RTMP *r, ulong sid, int type, char *name) · 49 unmodified lines
732 r->o.msg.cmd.aux = c;732 r->o.msg.cmd.aux = c;
733 r->o.msg.cmd.code = "NetStream.Publish.Start";733 r->o.msg.cmd.code = "NetStream.Publish.Start";
734 r->o.msg.sid = sid;734 r->o.msg.sid = sid;
735 n = rtmpsend(r);735 n = rtmpsend(r, 1);
736 736
737 qunlock(r);737 qunlock(r);
738 738
@@ -777,7 +777,7 @@ rtmpmeta(RTMP *r, ulong sid, int vcodec, int w, int h, int acodec) · 38 unmodified lines
777 putend();777 putend();
778 r->o.msg.sid = sid;778 r->o.msg.sid = sid;
779 779
780 res = rtmpsend(r);780 res = rtmpsend(r, 1);
781 781
782 qunlock(r);782 qunlock(r);
783 783
@@ -872,7 +872,7 @@ h264data(RTMP *r, ulong sid, u32int ts, u8int *p, int sz) · 88 unmodified lines
872 872
873 putdata(ps, p-ps);873 putdata(ps, p-ps);
874 874
875 if(rtmpsend(r) < 0)875 if(rtmpsend(r, 0) < 0)
876 return -1;876 return -1;
877 877
878 r->sps = 1;878 r->sps = 1;
@@ -898,7 +898,7 @@ h264data(RTMP *r, ulong sid, u32int ts, u8int *p, int sz) · 19 unmodified lines
898 putdata(p, nsz);898 putdata(p, nsz);
899 }899 }
900 900
901 return rtmpsend(r);901 return rtmpsend(r, 0);
902}902}
903 903
904static int904static int
@@ -944,7 +944,7 @@ aacdata(RTMP *r, ulong sid, u32int ts, u8int *p, int sz) · 39 unmodified lines
944 putbyte(0xe5);944 putbyte(0xe5);
945 putbyte(0x00);945 putbyte(0x00);
946 946
947 if(rtmpsend(r) < 0)947 if(rtmpsend(r, 0) < 0)
948 return -1;948 return -1;
949 949
950 r->aacpd = 1;950 r->aacpd = 1;
@@ -961,7 +961,7 @@ aacdata(RTMP *r, ulong sid, u32int ts, u8int *p, int sz) · 10 unmodified lines
961 961
962 putdata(p+7, sz-7);962 putdata(p+7, sz-7);
963 963
964 return rtmpsend(r);964 return rtmpsend(r, 0);
965}965}
966 966
967int967int
@@ -1011,7 +1011,7 @@ connect(RTMP *r) · 43 unmodified lines
1011 putkvnum("objectEncoding", 0); /* AMF0 */1011 putkvnum("objectEncoding", 0); /* AMF0 */
1012 putend();1012 putend();
1013 1013
1014 return rtmpsend(r);1014 return rtmpsend(r, 1);
1015}1015}
1016 1016
1017static int1017static int

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t