summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/modules/gstreamer/emotion_sink.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-09-30 15:39:16 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-09-30 15:39:16 +0000
commit9eb6ef192e03316f5505980796405616f0e7dbb8 (patch)
tree25a538151fb7e3c6baa20b48a305c309285c5c05 /legacy/emotion/src/modules/gstreamer/emotion_sink.c
parentd3c4e4fa0026058b1fbe996eee0c5bf21073fc88 (diff)
emotion: don't crash on empty video stream.
SVN revision: 63725
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_sink.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_sink.c b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
index dfb6e02a83..3634c002b7 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_sink.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
@@ -599,7 +599,7 @@ evas_video_sink_render(GstBaseSink* bsink, GstBuffer* buffer)
599 EvasVideoSinkPrivate *priv; 599 EvasVideoSinkPrivate *priv;
600 EvasVideoSink *sink; 600 EvasVideoSink *sink;
601 601
602 INF("sink render %p [%i]", GST_BUFFER_DATA(buffer), GST_BUFFER_SIZE(buffer)); 602 INF("sink render %p", buffer);
603 603
604 sink = EVAS_VIDEO_SINK(bsink); 604 sink = EVAS_VIDEO_SINK(bsink);
605 priv = sink->priv; 605 priv = sink->priv;
@@ -729,11 +729,15 @@ evas_video_sink_samsung_main_render(void *data)
729 gst_element_query_position(send->ev->pipeline, &fmt, &pos); 729 gst_element_query_position(send->ev->pipeline, &fmt, &pos);
730 send->ev->position = (double)pos / (double)GST_SECOND; 730 send->ev->position = (double)pos / (double)GST_SECOND;
731 731
732 vstream->width = priv->width; 732 if (vstream)
733 vstream->height = priv->height; 733 {
734 send->ev->ratio = (double) priv->width / (double) priv->height; 734 vstream->width = priv->width;
735 vstream->height = priv->height;
735 736
736 _emotion_video_pos_update(send->ev->obj, send->ev->position, vstream->length_time); 737 _emotion_video_pos_update(send->ev->obj, send->ev->position, vstream->length_time);
738 }
739
740 send->ev->ratio = (double) priv->width / (double) priv->height;
737 _emotion_frame_resize(send->ev->obj, priv->width, priv->height, send->ev->ratio); 741 _emotion_frame_resize(send->ev->obj, priv->width, priv->height, send->ev->ratio);
738 742
739 /* FIXME: why is last buffer not protected ? */ 743 /* FIXME: why is last buffer not protected ? */
@@ -1068,9 +1072,11 @@ gstreamer_video_sink_new(Emotion_Gstreamer_Video *ev,
1068 1072
1069#define GST_PLAY_FLAG_NATIVE_VIDEO (1 << 6) 1073#define GST_PLAY_FLAG_NATIVE_VIDEO (1 << 6)
1070#define GST_PLAY_FLAG_DOWNLOAD (1 << 7) 1074#define GST_PLAY_FLAG_DOWNLOAD (1 << 7)
1075#define GST_PLAY_FLAG_AUDIO (1 << 1)
1076#define GST_PLAY_FLAG_NATIVE_AUDIO (1 << 5)
1071 1077
1072 g_object_get(G_OBJECT(playbin), "flags", &flags, NULL); 1078 g_object_get(G_OBJECT(playbin), "flags", &flags, NULL);
1073 g_object_set(G_OBJECT(playbin), "flags", flags | GST_PLAY_FLAG_NATIVE_VIDEO | GST_PLAY_FLAG_DOWNLOAD, NULL); 1079 g_object_set(G_OBJECT(playbin), "flags", flags | GST_PLAY_FLAG_NATIVE_VIDEO | GST_PLAY_FLAG_DOWNLOAD | GST_PLAY_FLAG_NATIVE_AUDIO, NULL);
1074 g_object_set(G_OBJECT(playbin), "video-sink", sink, NULL); 1080 g_object_set(G_OBJECT(playbin), "video-sink", sink, NULL);
1075 g_object_set(G_OBJECT(playbin), "uri", uri, NULL); 1081 g_object_set(G_OBJECT(playbin), "uri", uri, NULL);
1076 1082