[FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments

Steven Liu lingjiujianke at gmail.com
Sun Sep 18 18:40:34 EEST 2016


2016-09-18 7:28 GMT+08:00 Steven Liu <lingjiujianke at gmail.com>:

>
>
> 2016-09-18 1:07 GMT+08:00 Michael Niedermayer <michael at niedermayer.cc>:
>
>> On Sat, Sep 17, 2016 at 01:09:02PM +0800, Steven Liu wrote:
>> [...]
>> > @@ -867,6 +886,16 @@ static int hls_write_header(AVFormatContext *s)
>> >      for (i = 0; i < s->nb_streams; i++) {
>> >          AVStream *inner_st;
>> >          AVStream *outer_st = s->streams[i];
>> > +
>> > +        if (hls->max_seg_size > 0) {
>> > +            if ((outer_st->codecpar->codec_type ==
>> AVMEDIA_TYPE_VIDEO) &&
>> > +                outer_st->codecpar->bit_rate > hls->max_seg_size) {
>> > +                av_log(s, AV_LOG_WARNING, "Your video bitrate is
>> bigger than hls_segment_size, "
>> > +                       "%lld > %lld ( video birate > hls_segment_size
>> ),the result maybe not you want.",
>> > +                       outer_st->codecpar->bit_rate,
>> hls->max_seg_size);
>>
>> %lld is the wrong type for *int64_t
>>
>> The compiler should produce a warning for this, though probably not
>> every copiler does
>> please make sure your changes add no warnings
>>
>
>
> Hi Michael,
>
>
> Bellow is my compile history before i send the last patch mail, maybe i
> need cross complie cross any platform:
>
>
> localhost:xxx StevenLiu$ make
> CC libavformat/hlsenc.o
> src/libavformat/hlsenc.c:326:14: error: use of undeclared identifier 'st'
>         if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) &&
>              ^
> src/libavformat/hlsenc.c:327:13: error: use of undeclared identifier 'st'
>             st->codecpar->bit_rate > hls->max_seg_size) {
>             ^
> src/libavformat/hlsenc.c:330:20: error: use of undeclared identifier 'st'
>                    st->codecpar->bit_rate, hls->max_seg_size);
>                    ^
> src/libavformat/hlsenc.c:573:27: warning: absolute value function 'abs'
> given an argument of type 'long' but has parameter of type 'int' which may
> cause truncation of value [-Wabsolute-value]
>                 tz_min = (abs(wrongsecs - tt) + 30) / 60;
>                           ^
> src/libavformat/hlsenc.c:573:27: note: use function 'labs' instead
>                 tz_min = (abs(wrongsecs - tt) + 30) / 60;
>                           ^~~
>                           labs
> 1 warning and 3 errors generated.
> make: *** [libavformat/hlsenc.o] Error 1
> localhost:xxx StevenLiu$ make
> CC libavformat/hlsenc.o
> src/libavformat/hlsenc.c:564:27: warning: absolute value function 'abs'
> given an argument of type 'long' but has parameter of type 'int' which may
> cause truncation of value [-Wabsolute-value]
>                 tz_min = (abs(wrongsecs - tt) + 30) / 60;
>                           ^
> src/libavformat/hlsenc.c:564:27: note: use function 'labs' instead
>                 tz_min = (abs(wrongsecs - tt) + 30) / 60;
>                           ^~~
>                           labs
> src/libavformat/hlsenc.c:890:18: error: use of undeclared identifier 'st'
>             if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) &&
>                  ^
> src/libavformat/hlsenc.c:891:17: error: use of undeclared identifier 'st'
>                 st->codecpar->bit_rate > hls->max_seg_size) {
>                 ^
> src/libavformat/hlsenc.c:894:24: error: use of undeclared identifier 'st'
>                        st->codecpar->bit_rate, hls->max_seg_size);
>                        ^
> 1 warning and 3 errors generated.
> make: *** [libavformat/hlsenc.o] Error 1
> localhost:xxx StevenLiu$
> localhost:xxx StevenLiu$
> localhost:xxx StevenLiu$ make
> CC libavformat/hlsenc.o
> src/libavformat/hlsenc.c:564:27: warning: absolute value function 'abs'
> given an argument of type 'long' but has parameter of type 'int' which may
> cause truncation of value [-Wabsolute-value]
>                 tz_min = (abs(wrongsecs - tt) + 30) / 60;
>                           ^
> src/libavformat/hlsenc.c:564:27: note: use function 'labs' instead
>                 tz_min = (abs(wrongsecs - tt) + 30) / 60;
>                           ^~~
>                           labs
> 1 warning generated.
> AR libavformat/libavformat.a
> LD ffmpeg_g
> CP ffmpeg
> STRIP ffmpeg
> LD ffplay_g
> CP ffplay
> STRIP ffplay
> LD ffprobe_g
> CP ffprobe
> STRIP ffprobe
> LD ffserver_g
> CP ffserver
> STRIP ffserver
> localhost:xxx StevenLiu$
>
>
>
patch update,

    fix warning for complie, from lld to PRId64
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avformat-hlsenc-refine-EXT-X-BYTERANGE-support-for-s.patch
Type: application/octet-stream
Size: 8353 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160918/5704db42/attachment.obj>


More information about the ffmpeg-devel mailing list