[FFmpeg-devel] [PATCH 2/2] SCTE-35 support in hlsenc
Michael Niedermayer
michael at niedermayer.cc
Fri Jul 22 02:42:06 EEST 2016
On Thu, Jul 21, 2016 at 03:31:32PM -0700, Carlos Fernandez Sanz wrote:
> From: carlos <carlos at ccextractor.org>
>
2 quick comments, not a full review
[...]
> @@ -147,69 +156,55 @@ static int hls_delete_old_segments(HLSContext *hls) {
> playlist_duration -= segment->duration;
> previous_segment = segment;
> segment = previous_segment->next;
> - if (playlist_duration <= -previous_segment->duration) {
> + //if (playlist_duration <= -previous_segment->duration) {
git keeps track of removed code, please dont keep outcommented code
in there, remove it instead if you want to remove it
[...]
> +static char* get_hls_string(struct scte_35_interface *iface, struct scte_35_event *event,
> + const char *filename, int out_state, int seg_count, int64_t pos)
> +{
> + int ret;
> + av_bprint_clear(&iface->avbstr);
> + if (out_state == EVENT_IN ) {
> + av_bprintf(&iface->avbstr, "#EXT-OATCLS-SCTE35:%s\n", iface->pkt_base64);
> + av_bprintf(&iface->avbstr, "#EXT-X-CUE-IN\n");
> + av_bprintf(&iface->avbstr, "#EXT-X-DISCONTINUITY\n");
> + } else if (out_state == EVENT_OUT) {
> + if (event)
> + {
> + av_bprintf(&iface->avbstr, "#EXT-OATCLS-SCTE35:%s\n", iface->pkt_base64);
> + if(event->duration != AV_NOPTS_VALUE) {
> + int64_t dur = ceil(((double)event->duration * iface->timebase.num) /iface->timebase.den);
> + av_bprintf(&iface->avbstr, "#EXT-X-CUE-OUT:%"PRIu64"\n", dur);
> + } else {
> + av_bprintf(&iface->avbstr, "#EXT-X-CUE-OUT\n");
> + }
> + av_bprintf(&iface->avbstr, "#EXT-X-DISCONTINUITY\n");
> + }
> + } else if (out_state == EVENT_OUT_CONT) {
> + if(event && event->duration != AV_NOPTS_VALUE) {
> + int64_t dur = ceil(((double)event->duration * iface->timebase.num) /iface->timebase.den);
> + int64_t elapsed_time = ceil(((double)pos * iface->timebase.num) /iface->timebase.den) - event->out_pts;
> + av_bprintf(&iface->avbstr, "#EXT-X-CUE-OUT-CONT:ElapsedTime=%"PRIu64",Duration=%"PRIu64",SCTE35=%s\n",
> + elapsed_time, dur, iface->pkt_base64);
> + } else {
> + av_bprintf(&iface->avbstr, "#EXT-X-CUE-OUT-CONT:SCTE35=%s\n", iface->pkt_base64);
> + }
> + }
tabs are forbidden in ffmpeg git
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160722/5929af67/attachment.sig>
More information about the ffmpeg-devel
mailing list