Fix some error handling in mod_libavcodec. Still crashes though.
authorpabs <pabs@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 11 Mar 2007 04:40:40 +0000 (04:40 +0000)
committerpabs <pabs@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 11 Mar 2007 04:40:40 +0000 (04:40 +0000)
git-svn-id: http://svn.voria.com/code@286 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp

index 7ceec6e..da8cfc6 100644 (file)
@@ -416,8 +416,8 @@ public:
                        //encode our given image
                        size = avcodec_encode_video(context, &videobuffer[0], videobuffer.size(), pict);
                        
-                       //if not zero we've got stuff to write
-                       if (size != 0)
+                       //if greater than zero we've got stuff to write
+                       if (size > 0)
                        {
                                av_init_packet(&pkt);
                                pkt.stream_index = stream->index;
@@ -431,7 +431,7 @@ public:
                                ret = av_write_frame(formatc, &pkt);
                                
                                //error detect - possibly throw later...
-                               if(ret != 0)
+                               if(ret < 0)
                                {
                                        synfig::warning("write_frame: error while writing video frame");
                                        return false;