diff mbox

[FFmpeg-devel] avformat/hlsenc: fix complie error when disable-network

Message ID 20171204153623.92997-1-lq@chinaffmpeg.org
State Accepted
Commit d67c1dda403288bcfd30b5d4a0412582728c2c79
Headers show

Commit Message

Liu Steven Dec. 4, 2017, 3:36 p.m. UTC
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/hlsenc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Tobias Rapp Dec. 4, 2017, 3:49 p.m. UTC | #1
On 04.12.2017 16:36, Steven Liu wrote:
> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
> ---
>   libavformat/hlsenc.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index aeeed5bcd2..7dc8f4237b 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -45,7 +45,9 @@
>   
>   #include "avformat.h"
>   #include "avio_internal.h"
> +#if CONFIG_HTTP_PROTOCOL
>   #include "http.h"
> +#endif
>   #include "hlsplaylist.h"
>   #include "internal.h"
>   #include "os_support.h"
> @@ -245,13 +247,15 @@ static int hlsenc_io_open(AVFormatContext *s, AVIOContext **pb, char *filename,
>                             AVDictionary **options) {
>       HLSContext *hls = s->priv_data;
>       int http_base_proto = is_http_proto(filename);
> -    int err;
> +    int err = AVERROR_MUXER_NOT_FOUND;
>       if (!*pb || !http_base_proto || !hls->http_persistent) {
>           err = s->io_open(s, pb, filename, AVIO_FLAG_WRITE, options);
> +#if CONFIG_HTTP_PROTOCOL
>       } else {
>           URLContext *http_url_context = ffio_geturlcontext(*pb);
>           av_assert0(http_url_context);
>           err = ff_http_do_new_request(http_url_context, filename);
> +#endif
>       }
>       return err;
>   }
> 

Thanks, this fixes the compile error.

Nit: there is a typo in the commit subject "complie" -> "compile"

Regards,
Tobias
Steven Liu Dec. 4, 2017, 3:53 p.m. UTC | #2
2017-12-04 23:49 GMT+08:00 Tobias Rapp <t.rapp@noa-archive.com>:
> On 04.12.2017 16:36, Steven Liu wrote:
>>
>> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
>> ---
>>   libavformat/hlsenc.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
>> index aeeed5bcd2..7dc8f4237b 100644
>> --- a/libavformat/hlsenc.c
>> +++ b/libavformat/hlsenc.c
>> @@ -45,7 +45,9 @@
>>     #include "avformat.h"
>>   #include "avio_internal.h"
>> +#if CONFIG_HTTP_PROTOCOL
>>   #include "http.h"
>> +#endif
>>   #include "hlsplaylist.h"
>>   #include "internal.h"
>>   #include "os_support.h"
>> @@ -245,13 +247,15 @@ static int hlsenc_io_open(AVFormatContext *s,
>> AVIOContext **pb, char *filename,
>>                             AVDictionary **options) {
>>       HLSContext *hls = s->priv_data;
>>       int http_base_proto = is_http_proto(filename);
>> -    int err;
>> +    int err = AVERROR_MUXER_NOT_FOUND;
>>       if (!*pb || !http_base_proto || !hls->http_persistent) {
>>           err = s->io_open(s, pb, filename, AVIO_FLAG_WRITE, options);
>> +#if CONFIG_HTTP_PROTOCOL
>>       } else {
>>           URLContext *http_url_context = ffio_geturlcontext(*pb);
>>           av_assert0(http_url_context);
>>           err = ff_http_do_new_request(http_url_context, filename);
>> +#endif
>>       }
>>       return err;
>>   }
>>
>
> Thanks, this fixes the compile error.
>
> Nit: there is a typo in the commit subject "complie" -> "compile"
Modify to "fix compiling error when disable-network", and pushed


Thanks
Steven
>
> Regards,
> Tobias
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
diff mbox

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index aeeed5bcd2..7dc8f4237b 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -45,7 +45,9 @@ 
 
 #include "avformat.h"
 #include "avio_internal.h"
+#if CONFIG_HTTP_PROTOCOL
 #include "http.h"
+#endif
 #include "hlsplaylist.h"
 #include "internal.h"
 #include "os_support.h"
@@ -245,13 +247,15 @@  static int hlsenc_io_open(AVFormatContext *s, AVIOContext **pb, char *filename,
                           AVDictionary **options) {
     HLSContext *hls = s->priv_data;
     int http_base_proto = is_http_proto(filename);
-    int err;
+    int err = AVERROR_MUXER_NOT_FOUND;
     if (!*pb || !http_base_proto || !hls->http_persistent) {
         err = s->io_open(s, pb, filename, AVIO_FLAG_WRITE, options);
+#if CONFIG_HTTP_PROTOCOL
     } else {
         URLContext *http_url_context = ffio_geturlcontext(*pb);
         av_assert0(http_url_context);
         err = ff_http_do_new_request(http_url_context, filename);
+#endif
     }
     return err;
 }