| OLD | NEW |
| 1 /* | 1 /* |
| 2 * RTMP network protocol | 2 * RTMP network protocol |
| 3 * Copyright (c) 2009 Kostya Shishkov | 3 * Copyright (c) 2009 Kostya Shishkov |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 if (data_left >= size) { | 908 if (data_left >= size) { |
| 909 memcpy(buf, rt->flv_data + rt->flv_off, size); | 909 memcpy(buf, rt->flv_data + rt->flv_off, size); |
| 910 rt->flv_off += size; | 910 rt->flv_off += size; |
| 911 return orig_size; | 911 return orig_size; |
| 912 } | 912 } |
| 913 if (data_left > 0) { | 913 if (data_left > 0) { |
| 914 memcpy(buf, rt->flv_data + rt->flv_off, data_left); | 914 memcpy(buf, rt->flv_data + rt->flv_off, data_left); |
| 915 buf += data_left; | 915 buf += data_left; |
| 916 size -= data_left; | 916 size -= data_left; |
| 917 rt->flv_off = rt->flv_size; | 917 rt->flv_off = rt->flv_size; |
| 918 return data_left; |
| 918 } | 919 } |
| 919 if ((ret = get_packet(s, 0)) < 0) | 920 if ((ret = get_packet(s, 0)) < 0) |
| 920 return ret; | 921 return ret; |
| 921 } | 922 } |
| 922 return orig_size; | 923 return orig_size; |
| 923 } | 924 } |
| 924 | 925 |
| 925 static int rtmp_write(URLContext *h, const uint8_t *buf, int size) | 926 static int rtmp_write(URLContext *h, const uint8_t *buf, int size) |
| 926 { | 927 { |
| 927 RTMPContext *rt = h->priv_data; | 928 RTMPContext *rt = h->priv_data; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 } | 990 } |
| 990 | 991 |
| 991 URLProtocol rtmp_protocol = { | 992 URLProtocol rtmp_protocol = { |
| 992 "rtmp", | 993 "rtmp", |
| 993 rtmp_open, | 994 rtmp_open, |
| 994 rtmp_read, | 995 rtmp_read, |
| 995 rtmp_write, | 996 rtmp_write, |
| 996 NULL, /* seek */ | 997 NULL, /* seek */ |
| 997 rtmp_close, | 998 rtmp_close, |
| 998 }; | 999 }; |
| OLD | NEW |