~ubuntu-branches/ubuntu/trusty/gst-plugins-base1.0/trusty-proposed

« back to all changes in this revision

Viewing changes to gst-libs/gst/rtsp/gstrtspconnection.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-09-24 16:24:47 UTC
  • mfrom: (1.1.18) (17.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20130924162447-0s1qfyjlaswtp1jg
* New upstream stable release:
  + debian/rules,
    debian/build-deps.in:
    - Build-depend on GStreamer >= 1.2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2785
2785
 
2786
2786
  GSource *readsrc;
2787
2787
  GSource *writesrc;
2788
 
  gboolean write_added;
2789
2788
 
2790
2789
  gboolean keep_running;
2791
2790
 
2975
2974
      /* get a new message from the queue */
2976
2975
      rec = g_queue_pop_tail (watch->messages);
2977
2976
      if (rec == NULL) {
2978
 
        if (watch->write_added) {
 
2977
        if (watch->writesrc) {
2979
2978
          g_source_remove_child_source ((GSource *) watch, watch->writesrc);
2980
 
          watch->write_added = FALSE;
2981
 
 
2982
 
          /* Need to create a new source as once removed/destroyed sources
2983
 
           * can't be attached again later */
2984
2979
          g_source_unref (watch->writesrc);
2985
 
          watch->writesrc =
2986
 
              g_pollable_output_stream_create_source (G_POLLABLE_OUTPUT_STREAM
2987
 
              (watch->conn->output_stream), NULL);
2988
 
          g_source_set_callback (watch->writesrc,
2989
 
              (GSourceFunc) gst_rtsp_source_dispatch_write, watch, NULL);
2990
 
          /* we add the write source when we actually have something to write */
 
2980
          watch->writesrc = NULL;
 
2981
          /* we create and add the write source again when we actually have
 
2982
           * something to write */
2991
2983
        }
2992
2984
        break;
2993
2985
      }
3147
3139
    g_source_unref (watch->readsrc);
3148
3140
  }
3149
3141
  if (watch->writesrc) {
3150
 
    if (watch->write_added) {
3151
 
      g_source_remove_child_source ((GSource *) watch, watch->writesrc);
3152
 
      watch->write_added = FALSE;
3153
 
    }
 
3142
    g_source_remove_child_source ((GSource *) watch, watch->writesrc);
3154
3143
    g_source_unref (watch->writesrc);
 
3144
    watch->writesrc = NULL;
3155
3145
  }
3156
3146
 
3157
3147
  if (watch->conn->input_stream) {
3165
3155
    watch->readsrc = NULL;
3166
3156
  }
3167
3157
 
3168
 
  if (watch->conn->output_stream) {
3169
 
    watch->writesrc =
3170
 
        g_pollable_output_stream_create_source (G_POLLABLE_OUTPUT_STREAM
3171
 
        (watch->conn->output_stream), NULL);
3172
 
    g_source_set_callback (watch->writesrc,
3173
 
        (GSourceFunc) gst_rtsp_source_dispatch_write, watch, NULL);
3174
 
    /* we add the write source when we actually have something to write */
3175
 
  } else {
3176
 
    watch->writesrc = NULL;
3177
 
  }
 
3158
  /* we create and add the write source when we actually have something to
 
3159
   * write */
3178
3160
}
3179
3161
 
3180
3162
/**
3343
3325
  /* make sure the main context will now also check for writability on the
3344
3326
   * socket */
3345
3327
  context = ((GSource *) watch)->context;
3346
 
  if (!watch->write_added) {
 
3328
  if (!watch->writesrc) {
 
3329
    watch->writesrc =
 
3330
        g_pollable_output_stream_create_source (G_POLLABLE_OUTPUT_STREAM
 
3331
        (watch->conn->output_stream), NULL);
 
3332
    g_source_set_callback (watch->writesrc,
 
3333
        (GSourceFunc) gst_rtsp_source_dispatch_write, watch, NULL);
3347
3334
    g_source_add_child_source ((GSource *) watch, watch->writesrc);
3348
 
    watch->write_added = TRUE;
3349
3335
  }
3350
3336
 
3351
3337
  if (id != NULL)