doc/examples: remove unneeded NULL checks
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 15 Aug 2014 22:27:14 +0000 (00:27 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Sep 2014 14:53:19 +0000 (16:53 +0200)
dst_file cannot be NULL

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 68bca03951b36755f46d75a5bcfcbba95ced21c4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/examples/resampling_audio.c
doc/examples/scaling_video.c

index 8a43b09..f35e7e1 100644 (file)
@@ -199,8 +199,7 @@ int main(int argc, char **argv)
             fmt, dst_ch_layout, dst_nb_channels, dst_rate, dst_filename);
 
 end:
             fmt, dst_ch_layout, dst_nb_channels, dst_rate, dst_filename);
 
 end:
-    if (dst_file)
-        fclose(dst_file);
+    fclose(dst_file);
 
     if (src_data)
         av_freep(&src_data[0]);
 
     if (src_data)
         av_freep(&src_data[0]);
index fcb98b7..587f3ab 100644 (file)
@@ -132,8 +132,7 @@ int main(int argc, char **argv)
            av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h, dst_filename);
 
 end:
            av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h, dst_filename);
 
 end:
-    if (dst_file)
-        fclose(dst_file);
+    fclose(dst_file);
     av_freep(&src_data[0]);
     av_freep(&dst_data[0]);
     sws_freeContext(sws_ctx);
     av_freep(&src_data[0]);
     av_freep(&dst_data[0]);
     sws_freeContext(sws_ctx);